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

Noob question: gatt client

I'm trying to reconcile two things I read about the softdevice. The GAP roles that are supported include broadcaster and peripheral. Also, there is support for a GATT client and GATT server.

It makes sense to me that the broadcaster and peripheral roles would want a GATT server. Under what conditions would those roles ever require a GATT client? I'll keep reading and I may end up finding the answer, but if somebody can set me straight in the mean time I'd appreciate it.

Thanks.

Parents
  • Hi there,

    I'm trying to reconcile two things I read about the softdevice. The GAP roles that are supported include broadcaster and peripheral. Also, there is support for a GATT client and GATT server.

    True for the S110 SoftDevice. On the S120 we support scanner and central, and GATT client and server.

    It makes sense to me that the broadcaster and peripheral roles would want a GATT server. Under what conditions would those roles ever require a GATT client? I'll keep reading and I may end up finding the answer, but if somebody can set me straight in the mean time I'd appreciate it.

    Short answer: GATT roles today are 100% independent of GAP roles.

    Long answer: It was originally intended that a GAP peripheral would only ever be a GATT server and a GAP central only a GATT client. For several reasons (some of them historical) this intention was set aside and today operating systems and devices support all 4 combinations:

    GAP central and GATT client GAP central and GATT server GAP peripheral and GATT client GAP peripheral and GATT server

    Our S110 SD allows your application to be a peripheral and both a GATT server and client at the same time.

    About what sense does it make, it really depends on how you design your profile layers. Usually the GATT server is the entity that holds the (often sensor extracted) data and and the GATT client is the peer querying and obtaining that data to store or display it. In some cases, both devices may have displays and sensors, and so it makes sense to combine roles.

    Completely made up example:

    Smartphone as central, thermometer (SD + app) with a temperature sensor and display as a peripheral.

    The peripheral measures and keeps a record of the current temperature as a GATT server, and the smartphone reads it over the air as a GATT client and displays it on the screen. But the same thermometer with a display and the SD running wants to display the time. In that case the thermometer would act simultaneously as a GATT client to query the time from the smartphone (which has it available through the GSM network) and display it. The smartphone would offer the current time value as a GATT server.

    Carles

Reply Children
No Data
Related