REST is a software architectural style that was created to guide the design and development of the architecture for the World Wide Web. A RESTful API is used to access resources over following commands:
- GET: Read/Retrieve a resource
- PUT: Update a resource
- POST: Create a resource
- DELETE: Delete/Remove a resource
REST can also be applied to embedded devices and provide a clear, well-known API for interacting with devices. The device acts as a REST server and provides its resources via a RESTful API for communication with clients such as Smartphone Apps.
Leitwert has implemented such a REST communication stack for embedded devices. The stack consists of a REST server and a BLE protocol. It allows any BLE device to be accessible over a RESTful API. As an embedded developer, you only need to register the resources and the appropriate actions to take as response to the REST command. Everything else is handled by the REST communication stack. As an app developer you can interact with the device very similarly now to what you are already used to from the Web.
Consider the case of an embedded device with an Inertial Measurement Unit (IMU). A smartphone application will be able to access the current IMU settings over BLE, with a GET command on the “/imu/settings/” resource:
There are many problems that can be solved using RESTful communication. We use it to optimize sensor settings on the go, select different configurations depending on the use case of the device or to unlock features for premium users.
Do You also use REST for your BLE devices?
Contact us using the button below to discuss, assess and improve communication of your BLE devices! We’re looking forward to hearing from you.