Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Brightness characteristic #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/common/hk_chrs_properties.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,17 @@ uint16_t hk_chrs_properties_get_prop(hk_chr_types_t chr_type)
return HK_CHR_PROP_SUPPORTS_READ;

case HK_CHR_ON:
case HK_CHR_BRIGHTNESS:
case HK_CHR_TARGET_POSITION:
return HK_CHR_PROP_SUPPORTS_SECURE_READS
| HK_CHR_PROP_SUPPORTS_SECURE_WRITES
| HK_CHR_PROP_NOTIFIES_EVENTS_CONNECTED_STATE
| HK_CHR_PROP_NOTIFIES_EVENTS_DISCONNECTED_STATE
| HK_CHR_PROP_SUPPORTS_BROADCAST_NOTIFY;

case HK_CHR_MOTION_DETECTED:
case HK_CHR_POSITION_STATE:
case HK_CHR_CURRENT_POSITION:
return HK_CHR_PROP_SUPPORTS_SECURE_READS
| HK_CHR_PROP_NOTIFIES_EVENTS_CONNECTED_STATE
| HK_CHR_PROP_NOTIFIES_EVENTS_DISCONNECTED_STATE
Expand Down Expand Up @@ -195,17 +199,14 @@ uint16_t hk_chrs_properties_get_prop(hk_chr_types_t chr_type)
case HK_CHR_BATTERY_LEVEL:
case HK_CHR_CARBON_MONOXIDE_DETECTED:
case HK_CHR_CONTACT_SENSOR_STATE:
case HK_CHR_CURRENT_POSITION:
case HK_CHR_LEAK_DETECTED:
case HK_CHR_OCCUPANCY_DETECTED:
case HK_CHR_POSITION_STATE:
case HK_CHR_PROGRAMMABLE_SWITCH_EVENT:
case HK_CHR_SMOKE_DETECTED:
case HK_CHR_STATUS_FAULT:
case HK_CHR_STATUS_JAMMED:
case HK_CHR_STATUS_LOW_BATTERY:
case HK_CHR_STATUS_TAMPERED:
case HK_CHR_TARGET_POSITION:
case HK_CHR_SECURITY_SYSTEM_ALARM_TYPE:
case HK_CHR_CHARGING_STATE:
case HK_CHR_CARBON_DIOXIDE_DETECTED:
Expand All @@ -226,7 +227,6 @@ uint16_t hk_chrs_properties_get_prop(hk_chr_types_t chr_type)
case HK_CHR_SERVICE_LABEL_NAMESPACE:
case HK_CHR_ACCESSORY_FLAGS:
case HK_CHR_COLOR_TEMPERATURE:
case HK_CHR_BRIGHTNESS:
case HK_CHR_ROTATION_DIRECTION:
case HK_CHR_CURRENT_HORIZONTAL_TILT_ANGLE:
case HK_CHR_CURRENT_VERTICAL_TILT_ANGLE:
Expand Down
3 changes: 3 additions & 0 deletions src/stacks/ble/hk_uuids.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ void hk_uuids_to_name(const ble_uuid128_t *uuid, char str[40])
case HK_CHR_ON:
sprintf(str, "ON");
break;
case HK_CHR_BRIGHTNESS:
sprintf(str, "BRIGHTNESS");
break;
case HK_CHR_SERIAL_NUMBER:
sprintf(str, "SERIAL_NUMBER");
break;
Expand Down