5 Replies Latest reply on Jan 7, 2016 5:37 PM by userc_18101

    hello_client(server?client?) hello_sensor(server?client?)

      SDK:2.2.2

      APP:hello_sensor and hello_client

      EVB:Tag3 and wiced sense

       

      The server can send the notification to the client in BLE spec.I would like to check the relationship between server and client in hello_client and hello_sensor.

       

      I tested two ways to confirm the client and server.

      1.The hello_sensor send notification to the hello_client.

      2.The hello_client send notification to the hello_sensor.

       

      I used the original program(hello_sensor and hello_client) in method 1.


      I add a service in GATT database of hello_sensor and the notification callback function in the method 2.

       

      PRIMARY_SERVICE_UUID128 (HDLS_client_not, __UUID_client_not),

       

      CHARACTERISTIC_UUID128 (HDLC_client_not_A1UUID,

                                                        HDLC_client_not_A1UUID_VALUE,

                                                        __UUID_client_not_A1UUID,

                                                        LEGATTDB_CHAR_PROP_READ | LEGATTDB_CHAR_PROP_NOTIFY

                                                        | LEGATTDB_CHAR_PROP_INDICATE,

                                                        LEGATTDB_PERM_READABLE, 11),

                                                        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

       

      CHAR_DESCRIPTOR_UUID16_WRITABLE (HDLD_client_not_A1UUID_CLIENT_CONFIGURATION,

                                                                                UUID_DESCRIPTOR_CLIENT_CHARACTERISTIC_CONFIGURATION,

                                                                                LEGATTDB_PERM_READABLE |

                                                                                 LEGATTDB_PERM_WRITE_REQ

                                                                                 | LEGATTDB_PERM_AUTH_WRITABLE,

                                                                                 2),

                                                                                 BIT16_TO_8(CCC_NOTIFICATION | CCC_INDICATION),     

       

      void hello_sensor_create(void){

           ........

           leatt_regNotificationCb((LEATT_TRIPLE_PARAM_CB) hello_client_notification_handler);//add notification callback

           ........

      }

       

      The hello_client will use the timer to send the notification.

      void hello_client_fine_timeout(UINT32 count){

           char abc[5]={'A','B','C','D','E'};

           bleprofile_sendNotification(HDLC_client_not_A1UUID_VALUE, &abc,sizeof(abc));

      }

       

      The receiver can receive the notification by transmitter(hello_sensor and hello_client) in method 1 and method 2.

       

      Is the client and server dynamic in hello_sensor or hello_client?


                notification or writeReq.

      Hello_client   ===>  Hello_sensor   (Hello_client is server, Hello_sensor is client)??


                notification or writeReq.

      Hello_client  <===  Hello_sensor   (Hello_client is client, Hello_sensor is server)??


      If I call the API like bleprofile_sendNotification or bleprofile_sendWriteReq,and it will change the role(server or client) in stack.Is it right?