Probleme WriteSync ???
Probleme WriteSync ???
- Subject: Probleme WriteSync ???
- From: Charette/Disto <email@hidden>
- Date: Wed, 13 Feb 2008 18:21:18 +0100
Hello
In general command is the first and the second buckle ...
After several tests it no longer works at all.
Thank you for assistance.
Sincerely
Interface Protocol
General definition
Characters
All characters of the ASCII-Code from 32 (0x20) up to 127 (0x7F) are
permitted.
A command is terminated with the control character <cr><lf> Carriage
Return, Line Feed -> 13,10 (0x0D, 0x0A).
The DISTOTM plus5 also terminates the response with <cr><lf>.
Definition: terminator <trm> = <cr><lf>.
Input
Every command consists of one or more characters and the terminator
Examples:
Function: Switch Laser on (pointing) or off
Input: o<trm> Laser on
p<trm> Laser off
Output: ?<trm> or @Exxx<trm>
- (BOOL)envoiSurDisto:(NSString *) message // @"o"
{
NSLog(@"le message en NSString : %@, taille %d, channel MTU = %
i",message,[message length],(int)[mChannel getMTU]);
BOOL ret ;
unsigned longueur ;
NSString * caractere = [[message stringByAppendingString:@"\r\n"]
retain]; //
NSData * Commande = [NSData dataWithData:[caractere
dataUsingEncoding:NSASCIIStringEncoding]];
longueur = [Commande length];
ret = [mChannel writeSync:[Commande bytes] length:longueur];
NSLog(@"apres writeSync caractere = %@",caractere);
NSLog(@"Resultat %d",ret);
[Commande release];
return ret ;
///
[mChannel setSerialParameters:9600 dataBits:8
parity:kBluetoothRFCOMMParityTypeNoParity stopBits:1];
Les Logs
Citation:
2008-02-12 12:08:57.927 distotest[1117] le message en NSString : o,
taille 1, channel MTU = 667
2008-02-12 12:08:57.935 distotest[1117] apres writeSync caractere = o
2008-02-12 12:08:57.935 distotest[1117] Resultat 0
Cordialement - Gilles @+
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden