Closed Manaf-A closed 10 months ago
when iam sending using send custom data it only shows one parameter .it only accepting one parameter .can anyone helpme or give any idea to do it
Hi @adbumanaf !
Yes it is possible, you can create another event to handle this, and just use :
var customAnswerBytes = await prov.sendReceiveCustomData(
Uint8List.fromList(
utf8.encode(event.customSendMessage),
),
);
var customAnswer = utf8.decode(customAnswerBytes);
log.i("Custom data answer: $customAnswer");
And in response to your question about sending an array of data rather than just a single string, you can transmit a List
list.reduce((value, element) => value + ',' + element)
Here, i use a comma (",") to separate the elements, or you can use a semicolon (";") if you prefer, and then handle the data on your ESP32 device.
While this package can temporarily transmit custom data to an ESP32, it is not intended for this purpose. As far as I recall, the ESP32 terminates the connection after provisioning, limiting data transmission to a brief period. You can use this package as a foundation for developing your own custom data transmission solution via BLE, but you will also need to modify the ESP32 provisioning code
this is not an issue .i want pass another custom data after connected with wifi.i want to pass the custom data to a particular endpoint .is it possible to do with this package .by using sendReceiveCustomData its only accept one argument