I've made an iOS app that receives RSSI values from a BLE Beacon and sends (using GCDAsynSocket) it to a connected MacBook over wifi. My next app on the MacBook receives the RSSI values and saves (using NSOutpuStream class) it in .txt format. Now, I need to send RSSI values from eight different BLE beacons and their respective MAC address in key/value pairs. I tried to solve it using NSKeyedArchiver to encode NSDictionary into NSData.
NSData *data = [NSKeyedArchiver archivedDataWithRootObject: NSDictionaryContaningKeyValuePair];
And on the receiver's end (MacBook), I used NSUnarchiver to decode. I am unable to extract the NSDictionary containing key/value (MAC address/RSSI values) pair and store it to the .txt file. Moreover, since NSoutputStrteam write method takes nonnull const uint8_t value, how can I write the Key/value pair in the .txt file? I use Objective-C and Xcode (7.0).
Thank you.