RPC: Add Virtual Display & Unify log tags (#814)
* RPC: Update protobuf sources * RPC: Add Virtual Display * Unify log tags * RPC: Virtual Display placeholder * Rpc: clear frame buffer callback before confirm. * Firmware: full assert for hal, move fatfs initialization to furi hal. * FuriHal: VCP optimizations, thread safe console. Rpc: adjust buffer sizes. Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <furi.h>
|
||||
|
||||
#define DEV_INFO_SVC_TAG "dev info service"
|
||||
#define TAG "BtDevInfoSvc"
|
||||
|
||||
typedef struct {
|
||||
uint16_t service_handle;
|
||||
@@ -29,7 +29,7 @@ void dev_info_svc_start() {
|
||||
uint16_t uuid = DEVICE_INFORMATION_SERVICE_UUID;
|
||||
status = aci_gatt_add_service(UUID_TYPE_16, (Service_UUID_t*)&uuid, PRIMARY_SERVICE, 9, &dev_info_svc->service_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to add Device Information Service: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to add Device Information Service: %d", status);
|
||||
}
|
||||
|
||||
// Add characteristics
|
||||
@@ -45,7 +45,7 @@ void dev_info_svc_start() {
|
||||
CHAR_VALUE_LEN_CONSTANT,
|
||||
&dev_info_svc->man_name_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to add manufacturer name char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to add manufacturer name char: %d", status);
|
||||
}
|
||||
uuid = SERIAL_NUMBER_UUID;
|
||||
status = aci_gatt_add_char(dev_info_svc->service_handle,
|
||||
@@ -59,7 +59,7 @@ void dev_info_svc_start() {
|
||||
CHAR_VALUE_LEN_CONSTANT,
|
||||
&dev_info_svc->serial_num_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to add serial number char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to add serial number char: %d", status);
|
||||
}
|
||||
uuid = FIRMWARE_REVISION_UUID;
|
||||
status = aci_gatt_add_char(dev_info_svc->service_handle,
|
||||
@@ -73,7 +73,7 @@ void dev_info_svc_start() {
|
||||
CHAR_VALUE_LEN_CONSTANT,
|
||||
&dev_info_svc->firmware_rev_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to add firmware revision char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to add firmware revision char: %d", status);
|
||||
}
|
||||
uuid = SOFTWARE_REVISION_UUID;
|
||||
status = aci_gatt_add_char(dev_info_svc->service_handle,
|
||||
@@ -87,7 +87,7 @@ void dev_info_svc_start() {
|
||||
CHAR_VALUE_LEN_CONSTANT,
|
||||
&dev_info_svc->software_rev_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to add software revision char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to add software revision char: %d", status);
|
||||
}
|
||||
|
||||
// Update characteristics
|
||||
@@ -97,7 +97,7 @@ void dev_info_svc_start() {
|
||||
strlen(dev_info_man_name),
|
||||
(uint8_t*)dev_info_man_name);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to update manufacturer name char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to update manufacturer name char: %d", status);
|
||||
}
|
||||
status = aci_gatt_update_char_value(dev_info_svc->service_handle,
|
||||
dev_info_svc->serial_num_char_handle,
|
||||
@@ -105,7 +105,7 @@ void dev_info_svc_start() {
|
||||
strlen(dev_info_serial_num),
|
||||
(uint8_t*)dev_info_serial_num);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to update serial number char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to update serial number char: %d", status);
|
||||
}
|
||||
status = aci_gatt_update_char_value(dev_info_svc->service_handle,
|
||||
dev_info_svc->firmware_rev_char_handle,
|
||||
@@ -113,7 +113,7 @@ void dev_info_svc_start() {
|
||||
strlen(dev_info_firmware_rev_num),
|
||||
(uint8_t*)dev_info_firmware_rev_num);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to update firmware revision char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to update firmware revision char: %d", status);
|
||||
}
|
||||
status = aci_gatt_update_char_value(dev_info_svc->service_handle,
|
||||
dev_info_svc->software_rev_char_handle,
|
||||
@@ -121,7 +121,7 @@ void dev_info_svc_start() {
|
||||
strlen(dev_info_software_rev_num),
|
||||
(uint8_t*)dev_info_software_rev_num);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to update software revision char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to update software revision char: %d", status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,24 +131,24 @@ void dev_info_svc_stop() {
|
||||
// Delete service characteristics
|
||||
status = aci_gatt_del_char(dev_info_svc->service_handle, dev_info_svc->man_name_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to delete manufacturer name char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to delete manufacturer name char: %d", status);
|
||||
}
|
||||
status = aci_gatt_del_char(dev_info_svc->service_handle, dev_info_svc->serial_num_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to delete serial number char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to delete serial number char: %d", status);
|
||||
}
|
||||
status = aci_gatt_del_char(dev_info_svc->service_handle, dev_info_svc->firmware_rev_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to delete firmware revision char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to delete firmware revision char: %d", status);
|
||||
}
|
||||
status = aci_gatt_del_char(dev_info_svc->service_handle, dev_info_svc->software_rev_char_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to delete software revision char: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to delete software revision char: %d", status);
|
||||
}
|
||||
// Delete service
|
||||
status = aci_gatt_del_service(dev_info_svc->service_handle);
|
||||
if(status) {
|
||||
FURI_LOG_E(DEV_INFO_SVC_TAG, "Failed to delete device info service: %d", status);
|
||||
FURI_LOG_E(TAG, "Failed to delete device info service: %d", status);
|
||||
}
|
||||
free(dev_info_svc);
|
||||
dev_info_svc = NULL;
|
||||
|
Reference in New Issue
Block a user