Bird
Raised Fist0
IOT Protocolsdevops~20 mins

Services and characteristics in IOT Protocols - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
BLE Services Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding BLE Services and Characteristics

In Bluetooth Low Energy (BLE), what is the primary role of a service?

AIt groups related characteristics to define a specific functionality.
BIt stores the device's MAC address for identification.
CIt encrypts data transmitted between devices.
DIt manages the power consumption of the BLE device.
Attempts:
2 left
💡 Hint

Think about how BLE organizes data to represent device features.

💻 Command Output
intermediate
2:00remaining
Output of BLE Characteristic Read Command

What is the expected output when reading a BLE characteristic that holds the battery level at 85%?

IOT Protocols
gatttool -b 00:11:22:33:44:55 --char-read --handle=0x0025
ACharacteristic value/descriptor: 0x55
BCharacteristic value/descriptor: 85
CCharacteristic value/descriptor: 55
DCharacteristic value/descriptor: 0x85
Attempts:
2 left
💡 Hint

Battery level is usually represented as a percentage in decimal.

❓ Configuration
advanced
3:00remaining
Configuring a Custom BLE Service

You want to create a custom BLE service with UUID 12345678-1234-5678-1234-56789abcdef0 and add a characteristic with UUID abcdef01-1234-5678-1234-56789abcdef0 that supports read and notify. Which configuration snippet correctly defines this in a typical BLE GATT server?

A
service_uuid = "12345678-1234-5678-1234-56789abcdef0"
characteristic_uuid = "abcdef01-1234-5678-1234-56789abcdef0"
properties = ["write", "notify"]
B
service_uuid = "12345678-1234-5678-1234-56789abcdef0"
characteristic_uuid = "abcdef01-1234-5678-1234-56789abcdef0"
properties = ["read", "notify"]
C
service_uuid = "12345678-1234-5678-1234-56789abcdef0"
characteristic_uuid = "abcdef01-1234-5678-1234-56789abcdef0"
properties = ["read", "write"]
D
service_uuid = "12345678-1234-5678-1234-56789abcdef0"
characteristic_uuid = "abcdef01-1234-5678-1234-56789abcdef0"
properties = ["write"]
Attempts:
2 left
💡 Hint

Check which properties allow reading and notifying.

❓ Troubleshoot
advanced
3:00remaining
Troubleshooting BLE Characteristic Notification Failure

You have configured a BLE characteristic to support notifications, but the client device never receives updates. Which is the most likely cause?

AThe client did not enable notifications by writing to the Client Characteristic Configuration Descriptor (CCCD).
BThe service UUID is missing from the GATT server.
CThe BLE device is advertising with low power mode enabled.
DThe characteristic UUID is not a standard 16-bit UUID.
Attempts:
2 left
💡 Hint

Think about what the client must do to receive notifications.

🔀 Workflow
expert
3:00remaining
Correct Order of BLE Service Discovery Steps

Arrange the following steps in the correct order to discover services and characteristics on a BLE device.

A1,3,2,4
B1,2,4,3
C2,1,3,4
D1,2,3,4
Attempts:
2 left
💡 Hint

Think about the logical sequence from connection to data access.

Practice

(1/5)
1. What is the main role of a service in IoT protocols?
easy
A. To encrypt communication between devices
B. To store individual data values
C. To define the device's network address
D. To group related data and functions on a device

Solution

  1. Step 1: Understand the concept of a service

    A service groups related data and functions on a device to organize them logically.
  2. Step 2: Differentiate service from characteristics

    Characteristics are individual data pieces inside a service, not the grouping itself.
  3. Final Answer:

    To group related data and functions on a device -> Option D
  4. Quick Check:

    Service = Grouping data [OK]
Hint: Services group data; characteristics hold data values [OK]
Common Mistakes:
  • Confusing services with characteristics
  • Thinking services store single data values
  • Mixing service role with network functions
2. Which of the following is the correct way to define a characteristic with read and write properties in a device configuration?
easy
A. characteristic: { uuid: '1234', properties: read; write }
B. characteristic: { uuid: '1234', properties: 'read, write' }
C. characteristic: { uuid: '1234', properties: ['read', 'write'] }
D. characteristic: { uuid: '1234', properties: read write }

Solution

  1. Step 1: Check the syntax for properties list

    Properties should be an array of strings, e.g., ['read', 'write'].
  2. Step 2: Identify correct syntax among options

    Only characteristic: { uuid: '1234', properties: ['read', 'write'] } uses an array with strings correctly; others use invalid formats.
  3. Final Answer:

    characteristic: { uuid: '1234', properties: ['read', 'write'] } -> Option C
  4. Quick Check:

    Properties as array of strings = characteristic: { uuid: '1234', properties: ['read', 'write'] } [OK]
Hint: Use array of strings for properties, not comma strings [OK]
Common Mistakes:
  • Using comma-separated string instead of array
  • Omitting quotes around property names
  • Using invalid separators like semicolons
3. Given this code snippet for a device service:
service = {
  uuid: 'abcd',
  characteristics: [
    { uuid: '1234', properties: ['read'] },
    { uuid: '5678', properties: ['write'] }
  ]
}
console.log(service.characteristics[1].properties.includes('write'))
What will be the output?
medium
A. false
B. true
C. undefined
D. Error

Solution

  1. Step 1: Access the second characteristic's properties

    service.characteristics[1] refers to the characteristic with uuid '5678'.
  2. Step 2: Check if 'write' is included in properties

    Its properties array is ['write'], so includes('write') returns true.
  3. Final Answer:

    true -> Option B
  4. Quick Check:

    Includes 'write' = true [OK]
Hint: Check array index and use includes() to verify property [OK]
Common Mistakes:
  • Confusing index 0 and 1 in array
  • Assuming includes returns false for single-item arrays
  • Expecting an error due to property access
4. You have this characteristic definition:
{ uuid: 'abcd', properties: ['read', 'notify'] }
But notifications are not working on your device. What is the most likely mistake?
medium
A. The 'notify' property is misspelled or unsupported
B. The characteristic is missing the 'write' property
C. The service UUID is incorrect
D. The characteristic UUID is too short

Solution

  1. Step 1: Verify the 'notify' property spelling and support

    Notifications require the 'notify' property spelled exactly and supported by device.
  2. Step 2: Check other options for relevance

    Missing 'write' does not affect notifications; UUID length or service UUID unrelated.
  3. Final Answer:

    The 'notify' property is misspelled or unsupported -> Option A
  4. Quick Check:

    Notification needs correct 'notify' property [OK]
Hint: Check spelling and support of 'notify' property first [OK]
Common Mistakes:
  • Assuming 'write' is needed for notifications
  • Blaming UUID length without evidence
  • Ignoring property spelling errors
5. You want to create a service with two characteristics: one readable temperature and one writable threshold. Which configuration correctly represents this?
hard
A. service: { uuid: 'temp', characteristics: [ { uuid: 'temp1', properties: ['read'] }, { uuid: 'thresh1', properties: ['write'] } ] }
B. service: { uuid: 'temp', characteristics: [ { uuid: 'temp1', properties: 'read' }, { uuid: 'thresh1', properties: 'write' } ] }
C. service: { uuid: 'temp', characteristics: [ { uuid: 'temp1', properties: ['write'] }, { uuid: 'thresh1', properties: ['read'] } ] }
D. service: { uuid: 'temp', characteristics: [ { uuid: 'temp1', properties: ['read', 'write'] }, { uuid: 'thresh1', properties: [] } ] }

Solution

  1. Step 1: Identify required properties for each characteristic

    Temperature characteristic must be readable only; threshold must be writable only.
  2. Step 2: Check each option's properties array

    service: { uuid: 'temp', characteristics: [ { uuid: 'temp1', properties: ['read'] }, { uuid: 'thresh1', properties: ['write'] } ] } correctly assigns ['read'] to temperature and ['write'] to threshold.
  3. Final Answer:

    service: { uuid: 'temp', characteristics: [ { uuid: 'temp1', properties: ['read'] }, { uuid: 'thresh1', properties: ['write'] } ] } -> Option A
  4. Quick Check:

    Correct properties arrays for read and write [OK]
Hint: Match properties array exactly to read or write need [OK]
Common Mistakes:
  • Using string instead of array for properties
  • Swapping read and write properties
  • Leaving properties empty when needed
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard