I'm trying to send hexadecimal data via WiFi.
The code is something like this:
NSString *abc = @"0x1b 0x50";
NSData *data = [[[NSData alloc] initWithData:[abc dataUsingEncoding:NSASCIIStringEncoding]]autorelease];
[outputStream write:[data bytes] maxLength:[data length]]];
Instead of sending the hexadecimal data, it's sending it in text format.
I tried with NSUTF8StringEncoding
, but it's the same. I'm using it with the NSStream
class.