This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Need help with implementating s110 and s120 pair of devices

Hi,

I am a little confuse at the moment and wondering if anyone would have any insight on the matter.

I am making a pair of device with s110 and s120. So the s120 will scan and the s110 will advertise. I needed the the server to be the s130 and the client to be the s110 device. So in other word the s120 has the data that the s110 needs but the s120 will initiate the connection.

My question is who would the implementation be? Lets say i am trying to make s110 get battery info from the s120. So the s120 would have the server code and the s110 would have the client code.
With bas and bas_c as example: bas has characteristic setting. This would be in the s120. bas_c has db_discovery. Would s110 be able to do discovery of service on the s120? I have been using it where the s120 is the client and the s110 is the server. But the s110 is advertising the service.

Would I have to make another service for the s110 to advertise to have the s120 look for since it is not actually advertising the battery service.

I need the battery from the s120 to be able to be sent to multiple s110 also would this implementation work?

Hope that makes sense. To sum it up. Two device s110 and s120. s120 has data that s110 want and s120 will send out notification when something change. Just trying to figure out a way to implement it.

Right now I have it as s110 advertising and s120 use that to connect and just sending out write command when a value change. But the read value from the s110 is giving wrong value sometime.

Thank you very much

Parents
  • We have some examples implementing GATT client in the S110, but we don't have any examples implementing GATT server in the S120. However, the S120 supports a full GATT server for 8 concurrent ATT server sessions. So it should be just to use the GATT server API in the same way it is used in the S110 examples.

    The S110 GATT client examples are:

    • ble_app_alert_notification
    • ble_app_cts_c (uses Database Discovery module)
    • ble_app_proximity
    • experimental_ble_app_ancs

    I would use one of the two first as a starting point.

    Would s110 be able to do discovery of service on the s120?

    Yes

    Would I have to make another service for the s110 to advertise to have the s120 look for since it is not actually advertising the battery service.

    You don't have to, but as you say the S120 needs something to look for. This doesn't need to be a service, it could be a device name, or a code or something in the manufacturer specific data.

    I need the battery from the s120 to be able to be sent to multiple s110 also would this implementation work?

    Sent is very unspecific, but multiple clients should be able to read the characteristic value, or multiple clients should be able to be notified or indicated with a characteristic. I haven't tested this myself, but I will try do it soon. Please let me know how it goes.

    Edit 29.04.2015: I just did a quick test. I added the the battery service to ble_app_hrs_c (GAP central and GATT server), and with ble_app_cts_c (GAP peripheral and GATT client) as a starting point I was able to discover and read the battery level.

Reply
  • We have some examples implementing GATT client in the S110, but we don't have any examples implementing GATT server in the S120. However, the S120 supports a full GATT server for 8 concurrent ATT server sessions. So it should be just to use the GATT server API in the same way it is used in the S110 examples.

    The S110 GATT client examples are:

    • ble_app_alert_notification
    • ble_app_cts_c (uses Database Discovery module)
    • ble_app_proximity
    • experimental_ble_app_ancs

    I would use one of the two first as a starting point.

    Would s110 be able to do discovery of service on the s120?

    Yes

    Would I have to make another service for the s110 to advertise to have the s120 look for since it is not actually advertising the battery service.

    You don't have to, but as you say the S120 needs something to look for. This doesn't need to be a service, it could be a device name, or a code or something in the manufacturer specific data.

    I need the battery from the s120 to be able to be sent to multiple s110 also would this implementation work?

    Sent is very unspecific, but multiple clients should be able to read the characteristic value, or multiple clients should be able to be notified or indicated with a characteristic. I haven't tested this myself, but I will try do it soon. Please let me know how it goes.

    Edit 29.04.2015: I just did a quick test. I added the the battery service to ble_app_hrs_c (GAP central and GATT server), and with ble_app_cts_c (GAP peripheral and GATT client) as a starting point I was able to discover and read the battery level.

Children
Related