Ceci est la pièce de code suivante de WiTap,WiTap Exemple dans l'iPhone
- (void) send:(const uint8_t)message
{
if (_outStream && [_outStream hasSpaceAvailable])
if([_outStream write:(const uint8_t *)&message maxLength:sizeof(const uint8_t)] == -1)
[self _showAlert:@"Failed sending data to peer"];
}
- (void) activateView:(TapView*)view
{
NSLog(@"ACTIVATE TAG: %d", [view tag]);
//[self send:[view tag] | 0x80];
[self send:[view tag]];
}
- (void) deactivateView:(TapView*)view
{
NSLog(@"DEACTIVATE TAG: %d", [view tag]);
//[self send:[view tag] & 0x7f];
[self send:[view tag]];
}
Est-il possible d'envoyer un fichier en utilisant WiTap? Comment envoyer NSData en utilisant la méthode d'envoi?
Merci