Skip to content
Draft
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
75 changes: 0 additions & 75 deletions include/ctrlm_ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@
#define CTRLM_MAIN_IARM_BUS_API_REVISION (16) ///< Revision of the Control Manager Main IARM API

#define CTRLM_MAIN_IARM_CALL_STATUS_GET "Main_StatusGet" ///< Retrieves Control Manager's Status information
#define CTRLM_MAIN_IARM_CALL_NETWORK_STATUS_GET "Main_NetworkStatusGet" ///< Retrieves the network's Status information
#define CTRLM_MAIN_IARM_CALL_PROPERTY_SET "Main_PropertySet" ///< Sets a property of the Control Manager
#define CTRLM_MAIN_IARM_CALL_FACTORY_RESET "Main_FactoryReset" ///< Sets the configuration back to factory default
#define CTRLM_MAIN_IARM_CALL_CONTROLLER_UNBIND "Main_ControllerUnbind" ///< Removes a binding between the target and the specified controller
#define CTRLM_MAIN_IARM_CALL_IR_REMOTE_USAGE_GET "Main_IrRemoteUsageGet" ///< Retrieves the ir remote usage info
#define CTRLM_MAIN_IARM_CALL_LAST_KEY_INFO_GET "Main_LastKeyInfoGet" ///< Retrieves the last key info
#define CTRLM_MAIN_IARM_CALL_LAST_KEYPRESS_GET "Main_LastKeyPressGet" ///< Retrieves the last key press (TODO: replace CTRLM_MAIN_IARM_CALL_LAST_KEY_INFO_GET with this)
#define CTRLM_MAIN_IARM_CALL_CONTROL_SERVICE_SET_VALUES "Main_ControlService_SetValues" ///< IARM Call to set control service values
#define CTRLM_MAIN_IARM_CALL_CONTROL_SERVICE_GET_VALUES "Main_ControlService_GetValues" ///< IARM Call to get control service values
#define CTRLM_MAIN_IARM_CALL_PAIRING_METRICS_GET "Main_PairingMetricsGet" ///< Retrieves the stb's pairing metrics
#define CTRLM_MAIN_IARM_CALL_AUDIO_CAPTURE_START "Main_AudioCaptureStart" ///< Sends message to xraudio to capture mic data, in specified container
#define CTRLM_MAIN_IARM_CALL_AUDIO_CAPTURE_STOP "Main_AudioCaptureStop" ///< Sends message to xraudio to stop capturing mic data
#define CTRLM_MAIN_IARM_CALL_POWER_STATE_CHANGE "Main_PowerStateChange" ///< Sends message to xr-speech-router to set power state, download DSP firmware, etc
Expand Down Expand Up @@ -365,48 +362,6 @@ typedef struct {
unsigned char quality; ///< Quality indicator for this channel
} ctrlm_rf_channel_t;

/// @brief RF4CE Network Status Structure
/// @details The RF4CE Network Status structure provided detailed information about the network.
typedef struct {
char version_hal[CTRLM_MAIN_VERSION_LENGTH]; ///< Software version of the HAL driver
unsigned char controller_qty; ///< Number of controllers bound to the target device
ctrlm_controller_id_t controllers[CTRLM_MAIN_MAX_BOUND_CONTROLLERS]; ///< List of controllers bound to the target device
unsigned short pan_id; ///< PAN Identifier
ctrlm_rf_channel_t rf_channel_active; ///< Current RF channel on which the target is operating
unsigned long long ieee_address; ///< The 64-bit IEEE Address of the target device
unsigned short short_address; ///< Short address (if applicable)
char chipset[CTRLM_MAIN_MAX_CHIPSET_LENGTH]; ///< Chipset of the target
} ctrlm_network_status_rf4ce_t;

/// @brief Bluetooth LE Network Status Structure
/// @details The Bluetooth LE Network Status structure provided detailed information about the network.
typedef struct {
char version_hal[CTRLM_MAIN_VERSION_LENGTH]; ///< Software version of the HAL driver
unsigned char controller_qty; ///< Number of controllers bound to the target device.
ctrlm_controller_id_t controllers[CTRLM_MAIN_MAX_BOUND_CONTROLLERS]; ///< List of controllers bound to the target device
} ctrlm_network_status_ble_t;

/// @brief IP Network Status Structure
/// @details The IP Network Status structure provided detailed information about the network.
typedef struct {
char version_hal[CTRLM_MAIN_VERSION_LENGTH]; ///< Software version of the HAL driver
unsigned char controller_qty; ///< Number of controllers bound to the target device.
ctrlm_controller_id_t controllers[CTRLM_MAIN_MAX_BOUND_CONTROLLERS]; ///< List of controllers bound to the target device
} ctrlm_network_status_ip_t;

/// @brief Network Status Structure
/// @details The Network Status structure is used in the CTRLM_MAIN_IARM_CALL_NETWORK_STATUS_GET call. See the @link CTRLM_IPC_MAIN_CALLS Calls@endlink section for more details on invoking this call.
typedef struct {
unsigned char api_revision; ///< Revision of this API
ctrlm_iarm_call_result_t result; ///< OUT - Result of the operation
ctrlm_network_id_t network_id; ///< IN - identifier of network
union {
ctrlm_network_status_rf4ce_t rf4ce; ///< OUT - RF4CE network status
ctrlm_network_status_ble_t ble; ///< OUT - BLE network status
ctrlm_network_status_ip_t ip; ///< OUT - IP network status
} status; ///< OUT - Union of network status types
} ctrlm_main_iarm_call_network_status_t;

typedef struct {
unsigned char api_revision; ///< Revision of this API
ctrlm_iarm_call_result_t result; ///< Result of the operation
Expand Down Expand Up @@ -445,22 +400,6 @@ typedef struct {
ctrlm_unbind_reason_t reason; ///< Reason that the controller binding was removed
} ctrlm_main_iarm_event_controller_unbind_t;

typedef struct {
unsigned char api_revision; ///< Revision of this API
ctrlm_iarm_call_result_t result; ///< OUT - The result of the operation.
unsigned long today; ///< OUT - The current day
unsigned char has_ir_xr2_yesterday; ///< OUT - Boolean value indicating XR2 in IR mode was used the previous day
unsigned char has_ir_xr5_yesterday; ///< OUT - Boolean value indicating XR5 in IR mode was used the previous day
unsigned char has_ir_xr11_yesterday; ///< OUT - Boolean value indicating XR11 in IR mode was used the previous day
unsigned char has_ir_xr15_yesterday; ///< OUT - Boolean value indicating XR15 in IR mode was used the previous day
unsigned char has_ir_xr2_today; ///< OUT - Boolean value indicating XR2 in IR mode was used the current day
unsigned char has_ir_xr5_today; ///< OUT - Boolean value indicating XR5 in IR mode was used the current day
unsigned char has_ir_xr11_today; ///< OUT - Boolean value indicating XR11 in IR mode was used the current day
unsigned char has_ir_xr15_today; ///< OUT - Boolean value indicating XR15 in IR mode was used the current day
unsigned char has_ir_remote_yesterday; ///< OUT - Boolean value indicating remote in IR mode was used the previous day
unsigned char has_ir_remote_today; ///< OUT - Boolean value indicating remote in IR mode was used the current day
} ctrlm_main_iarm_call_ir_remote_usage_t;

typedef struct {
unsigned char api_revision; ///< Revision of this API
ctrlm_network_id_t network_id; ///< IN - identifier of network on which the controller is bound
Expand Down Expand Up @@ -498,20 +437,6 @@ typedef struct {
unsigned int bind_status; ///< OUT - The bind status of the pairing session
} ctrlm_main_iarm_call_control_service_pairing_mode_t;

typedef struct {
unsigned char api_revision; ///< Revision of this API
ctrlm_iarm_call_result_t result; ///< OUT - The result of the operation.
unsigned long num_screenbind_failures; ///< OUT - The total number of screenbind failures on this stb
unsigned long last_screenbind_error_timestamp; ///< OUT - Timestamp of the last screenbind error
ctrlm_bind_status_t last_screenbind_error_code; ///< OUT - The last screenbind error code
char last_screenbind_remote_type[CTRLM_MAIN_SOURCE_NAME_MAX_LENGTH]; ///< OUT - The last screenbind error remote type
unsigned long num_non_screenbind_failures; ///< OUT - The total number of screenbind failures on this stb
unsigned long last_non_screenbind_error_timestamp; ///< OUT - Timestamp of the last screenbind error
ctrlm_bind_status_t last_non_screenbind_error_code; ///< OUT - The last screenbind error code
unsigned char last_non_screenbind_error_binding_type; ///< OUT - The last screenbind error binding type
char last_non_screenbind_remote_type[CTRLM_MAIN_SOURCE_NAME_MAX_LENGTH]; ///< OUT - The last screenbind error remote type
} ctrlm_main_iarm_call_pairing_metrics_t;

typedef struct {
ctrlm_controller_id_t controller_id; ///< identifier of the controller, used for calls to a specific RCU
char ieee_address_str[CTRLM_MAX_PARAM_STR_LEN];
Expand Down
28 changes: 0 additions & 28 deletions src/ble/ctrlm_ble_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,34 +468,6 @@ void ctrlm_obj_network_ble_t::thread_monitor_poll(ctrlm_thread_monitor_response_
// ==================================================================================================================================================================
// BEGIN - Process Requests to the network in CTRLM Main thread context
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------
void ctrlm_obj_network_ble_t::req_process_network_status(void *data, int size) {
THREAD_ID_VALIDATE();
ctrlm_main_queue_msg_main_network_status_t *dqm = (ctrlm_main_queue_msg_main_network_status_t *)data;

g_assert(dqm);
g_assert(size == sizeof(ctrlm_main_queue_msg_main_network_status_t));
g_assert(dqm->cmd_result);

ctrlm_network_status_ble_t *network_status = &dqm->status->status.ble;
errno_t safec_rc = strncpy_s(network_status->version_hal, sizeof(network_status->version_hal), version_get(), CTRLM_MAIN_VERSION_LENGTH - 1);
ERR_CHK(safec_rc);
network_status->version_hal[CTRLM_MAIN_VERSION_LENGTH - 1] = '\0';
network_status->controller_qty = controllers_.size();
XLOGD_INFO("HAL Version <%s> Controller Qty %u", network_status->version_hal, network_status->controller_qty);
int index = 0;
for(auto const &itr : controllers_) {
network_status->controllers[index] = itr.first;
index++;
if(index >= CTRLM_MAIN_MAX_BOUND_CONTROLLERS) {
break;
}
}
dqm->status->result = CTRLM_IARM_CALL_RESULT_SUCCESS;
*dqm->cmd_result = CTRLM_MAIN_STATUS_REQUEST_SUCCESS;

ctrlm_obj_network_t::req_process_network_status(data, size);
}

void ctrlm_obj_network_ble_t::req_process_controller_status(void *data, int size) {
THREAD_ID_VALIDATE();
ctrlm_main_queue_msg_controller_status_t *dqm = (ctrlm_main_queue_msg_controller_status_t *)data;
Expand Down
1 change: 0 additions & 1 deletion src/ble/ctrlm_ble_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ class ctrlm_obj_network_ble_t : public ctrlm_obj_network_t {
void ind_process_keypress(void *data, int size);
void ind_process_rcu_pairing_outcome(void *data, int size);

virtual void req_process_network_status(void *data, int size);
virtual void req_process_controller_status(void *data, int size);

virtual void req_process_voice_session_begin(void *data, int size);
Expand Down
43 changes: 32 additions & 11 deletions src/ctrlm.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,6 @@ typedef struct {
ctrlm_main_status_cmd_result_t *cmd_result;
} ctrlm_main_queue_msg_main_status_t;

typedef struct {
ctrlm_main_iarm_call_network_status_t *status;
sem_t * semaphore;
ctrlm_main_status_cmd_result_t * cmd_result;
} ctrlm_main_queue_msg_main_network_status_t;

typedef struct {
ctrlm_iarm_call_result_t result;
ctrlm_network_id_t network_id;
Expand Down Expand Up @@ -227,16 +221,44 @@ typedef struct {
ctrlm_main_status_cmd_result_t *cmd_result;
} ctrlm_main_queue_msg_product_name_t;

typedef struct {
ctrlm_iarm_call_result_t result;
unsigned long today;
unsigned char has_ir_xr2_yesterday;
unsigned char has_ir_xr5_yesterday;
unsigned char has_ir_xr11_yesterday;
unsigned char has_ir_xr15_yesterday;
unsigned char has_ir_xr2_today;
unsigned char has_ir_xr5_today;
unsigned char has_ir_xr11_today;
unsigned char has_ir_xr15_today;
unsigned char has_ir_remote_yesterday;
unsigned char has_ir_remote_today;
} ctrlm_ir_remote_usage_t;

typedef struct {
ctrlm_iarm_call_result_t result;
unsigned long num_screenbind_failures;
unsigned long last_screenbind_error_timestamp;
ctrlm_bind_status_t last_screenbind_error_code;
char last_screenbind_remote_type[CTRLM_MAIN_SOURCE_NAME_MAX_LENGTH];
unsigned long num_non_screenbind_failures;
unsigned long last_non_screenbind_error_timestamp;
ctrlm_bind_status_t last_non_screenbind_error_code;
unsigned char last_non_screenbind_error_binding_type;
char last_non_screenbind_remote_type[CTRLM_MAIN_SOURCE_NAME_MAX_LENGTH];
} ctrlm_pairing_metrics_status_t;

typedef struct {
ctrlm_main_queue_msg_type_t type;
ctrlm_main_iarm_call_ir_remote_usage_t *ir_remote_usage;
ctrlm_ir_remote_usage_t *ir_remote_usage;
sem_t *semaphore;
ctrlm_main_status_cmd_result_t *cmd_result;
} ctrlm_main_queue_msg_ir_remote_usage_t;

typedef struct {
ctrlm_main_queue_msg_type_t type;
ctrlm_main_iarm_call_pairing_metrics_t *pairing_metrics;
ctrlm_pairing_metrics_status_t *pairing_metrics;
sem_t *semaphore;
ctrlm_main_status_cmd_result_t *cmd_result;
} ctrlm_main_queue_msg_pairing_metrics_t;
Expand Down Expand Up @@ -424,11 +446,10 @@ gboolean ctrlm_power_state_change(ctrlm_power_state_t
bool ctrlm_main_active_period_screenbind_timeout_set_(uint32_t timeout);

gboolean ctrlm_main_iarm_call_status_get(ctrlm_main_iarm_call_status_t *status);
gboolean ctrlm_main_iarm_call_network_status_get(ctrlm_main_iarm_call_network_status_t *status);
gboolean ctrlm_main_iarm_call_factory_reset(ctrlm_main_iarm_call_factory_reset_t *reset);
gboolean ctrlm_main_iarm_call_controller_unbind(ctrlm_main_iarm_call_controller_unbind_t *unbind);
gboolean ctrlm_main_iarm_call_ir_remote_usage_get(ctrlm_main_iarm_call_ir_remote_usage_t *ir_remote_usage);
gboolean ctrlm_main_iarm_call_pairing_metrics_get(ctrlm_main_iarm_call_pairing_metrics_t *pairing_metrics);
gboolean ctrlm_main_ir_remote_usage_get(ctrlm_ir_remote_usage_t *ir_remote_usage);
gboolean ctrlm_main_pairing_metrics_get(ctrlm_pairing_metrics_status_t *pairing_metrics);
gboolean ctrlm_main_iarm_call_last_key_info_get(ctrlm_main_iarm_call_last_key_info_t *last_key_info);
gboolean ctrlm_main_iarm_call_control_service_set_values(ctrlm_main_iarm_call_control_service_settings_t *settings);
gboolean ctrlm_main_iarm_call_control_service_get_values(ctrlm_main_iarm_call_control_service_settings_t *settings);
Expand Down
Loading
Loading