Skip to content

Peripheral device does not receive values ​​written by the central device #81

Open
@avilmaru

Description

@avilmaru

Central Device: Arduino 33 BLE Sense
Peripheral device: Arduino MKR WiFi 1010.

Upgrading from version 1.1.0 to version 1.1.2 the peripheral device does not receive values ​​written by the central device. Before everything worked correctly.


*** Central device code ***

// ....

while (peripheral.connected()) {

    String command = calculoAngulos(); 
   
    if (command != "")
    {
      int n = command.length(); 
      // declaring character array 
      char char_array[n + 1]; 
      // copying the contents of the string to char array 
      strcpy(char_array, command.c_str()); 
      gestureCharacteristic.writeValue((const char*)char_array);
     delay(1);
    }
  
  }
// ... etc

*** Peripheral device code ***

// ....

 // while the central is still connected to peripheral:
    while (central.connected()) {
      
      // if the remote device wrote to the characteristic,
      if (gestureCharacteristic.written()) {
         command = gestureCharacteristic.value();
         //Serial.print(F("commmand value:  "));
         //Serial.println(command);
       }
      
    }

// ... etc

--> Both devices are connected correctly
--> in version 1.1.0 it works correctly!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions