The code below addumes (as you do) that the length is less than 65536 (two bytes). So you need to use:
uint16_t len = CFSwapInt16HostToBig([data length]);
NSMutableData *sendData = [[NSMutableData alloc] initWithBytes:&len length:2];
[sendData appendData:data];
The list of available function are described in de document below in the apple developer library: