It seems that the size of the RemoteXY_CONF is the key to understand the issue.
Here are examples that work every single time I try to connect to the BLE device:
Button
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,1,0,0,0,13,0,11,13,0,
1,0,40,23,12,12,2,31,88,0 };
Select
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,1,0,0,0,11,0,11,13,0,
3,3,54,19,8,22,2,26 };
Joystick
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,2,0,0,0,12,0,11,13,0,
5,0,36,16,30,30,2,26,31 };
Slider
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,1,0,0,0,11,0,11,13,0,
4,0,43,22,7,18,2,26 };
Edit field
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,11,0,0,0,13,0,11,13,0,
7,36,36,26,20,5,2,26,2,11 };
RGB button
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,3,0,0,0,11,0,11,13,0,
6,0,38,21,20,20,2,26 };
Arc Level
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,0,0,1,0,11,0,11,13,0,
66,130,41,25,13,10,2,26 };
Online Graph
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,0,0,4,0,11,0,11,13,0,
68,17,33,22,20,20,8,36 };
And here are cases where it does not work:
ON-OFF button
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,1,0,0,0,20,0,11,13,0,
2,0,34,24,22,11,2,26,31,31,
79,78,0,79,70,70,0 };
2 sliders
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,2,0,0,0,19,0,11,13,0,
4,0,23,20,7,18,2,26,4,0,
46,21,7,18,2,26 };
A slider and a joystick
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,3,0,0,0,20,0,11,13,0,
4,0,20,13,5,41,2,26,5,0,
46,9,48,48,2,26,31 };
The obvious different for me is the size of the message. The system works for short initialization messages. Could it be the bluetooth is "too slow"? Have you ever experienced this type of issue? Is there a way to extend the timeout?
As a reference the whole code is available here: https://github.com/luizvilla/remoteXY_BLE_nano