bonjour
j'essaye d'envoyer en bluetooth low energy une trame mais je reçois toujours des erreurs lors de l'envoi.
NB: la trame qui est affichée sur Delphi est bonne par contre sur le terminal c'est pas bon
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 procedure TForm6.Button1Click(Sender: TObject); var framet : string; address : byte; fct : byte; startadress : word; registers : longword; I :Byte; chaine : string; begin if FBLEDevice <> nil then begin address := $04; fct := $01; startadress := $0A; registers := $0D; frameT := Readcoils( address, fct, startadress, registers); for I := 1 to length(framet) do Chaine:=Chaine+ ' ' + inttohex(ord(frameT[I]),2); Memo1.Lines.Add( ' WRITE: ' + chaine ); FBLEGattChar.SetValueAsString(chaine); // recupere le text sous format string FBLEDevice.WriteCharacteristic(FBLEGattChar); // envoie du text end; end;
Partager