1 Reply Latest reply on Oct 21, 2015 8:04 AM by crodriguez

    Read Characteristic in CLIENT from SERVER

    crodriguez

      Hi, i have two nodes, one of them, as a SERVER (Pripheral) an other as CLIENT (CENTRAL),  in the SERVER, i update some sensor datas with:

         

       

         

      CyBle_GattsWriteAttributeValue();

         

       

         

      And i want to read this values in the CLIENT, the connect is succesfully, but i have some problems when i read the data. The connection it is OK, later  discover the GATT client in the server, and when is Discovered:

         

      CYBLE_EVT_GATTC_DISCOVERY_COMPLETE:

         

      I read the value with:

         

      range.endHandle = 0x0030;
                      uuid.uuid16 = address;

         

                      readByTypeReqParam.range = range;
                      readByTypeReqParam.uuid = uuid;
                      readByTypeReqParam.uuidFormat = 0x01;
                      
                      apiResult = CyBle_GattcReadUsingCharacteristicUuid(connHandle, &readByTypeReqParam);

         

       

         

      Later i read the value with:

         

       case CYBLE_EVT_GATTC_READ_RSP:
              
              readResponse = *(CYBLE_GATTC_READ_RSP_PARAM_T *) eventParam;

         

       

         

      All OK, but if i want to extract this code in a function, it doesn´t work it return to me: apiResult = CyBle_GattcReadUsingCharacteristicUuid(connHandle, &readByTypeReqParam);

         

      Anyone know where it is the problem?

         

       

         

      Thanks for all