int STDCALL stream_input_descriptor_imp::send_get_stream_info_cmd(void * notification_id) { struct jdksavdecc_frame cmd_frame; struct jdksavdecc_aem_command_get_stream_info aem_cmd_get_stream_info; ssize_t aem_cmd_get_stream_info_returned; memset(&aem_cmd_get_stream_info, 0, sizeof(aem_cmd_get_stream_info)); /******************************************** AECP Common Data *******************************************/ aem_cmd_get_stream_info.aem_header.aecpdu_header.controller_entity_id = base_end_station_imp_ref->get_adp()->get_controller_entity_id(); // Fill aem_cmd_get_stream_info.sequence_id in AEM Controller State Machine aem_cmd_get_stream_info.aem_header.command_type = JDKSAVDECC_AEM_COMMAND_GET_STREAM_INFO; /****************** AECP Message Specific Data ***************/ aem_cmd_get_stream_info.descriptor_type = descriptor_type(); aem_cmd_get_stream_info.descriptor_index = descriptor_index(); /************************** Fill frame payload with AECP data and send the frame ***************************/ aecp_controller_state_machine_ref->ether_frame_init(base_end_station_imp_ref->mac(), &cmd_frame, ETHER_HDR_SIZE + JDKSAVDECC_AEM_COMMAND_GET_STREAM_INFO_COMMAND_LEN); aem_cmd_get_stream_info_returned = jdksavdecc_aem_command_get_stream_info_write(&aem_cmd_get_stream_info, cmd_frame.payload, ETHER_HDR_SIZE, sizeof(cmd_frame.payload)); if (aem_cmd_get_stream_info_returned < 0) { log_imp_ref->post_log_msg(LOGGING_LEVEL_ERROR, "aem_cmd_get_stream_info_write error\n"); assert(aem_cmd_get_stream_info_returned >= 0); return -1; } aecp_controller_state_machine_ref->common_hdr_init(JDKSAVDECC_AECP_MESSAGE_TYPE_AEM_COMMAND, &cmd_frame, base_end_station_imp_ref->entity_id(), JDKSAVDECC_AEM_COMMAND_GET_STREAM_INFO_COMMAND_LEN - JDKSAVDECC_COMMON_CONTROL_HEADER_LEN); system_queue_tx(notification_id, CMD_WITH_NOTIFICATION, cmd_frame.payload, cmd_frame.length); return 0; }
int STDCALL stream_input_descriptor_imp::send_get_stream_info_cmd(void *notification_id) { struct jdksavdecc_frame *cmd_frame; struct jdksavdecc_aem_command_get_stream_info aem_cmd_get_stream_info; int aem_cmd_get_stream_info_returned; cmd_frame = (struct jdksavdecc_frame *)malloc(sizeof(struct jdksavdecc_frame)); /******************************************** AECP Common Data *******************************************/ aem_cmd_get_stream_info.controller_entity_id = base_end_station_imp_ref->get_adp()->get_controller_guid(); // Fill aem_cmd_get_stream_info.sequence_id in AEM Controller State Machine aem_cmd_get_stream_info.command_type = JDKSAVDECC_AEM_COMMAND_GET_STREAM_INFO; /****************** AECP Message Specific Data ***************/ aem_cmd_get_stream_info.descriptor_type = descriptor_type(); aem_cmd_get_stream_info.descriptor_index = descriptor_index(); /************************** Fill frame payload with AECP data and send the frame ***************************/ aem_controller_state_machine_ref->ether_frame_init(base_end_station_imp_ref->mac(), cmd_frame); aem_cmd_get_stream_info_returned = jdksavdecc_aem_command_get_stream_info_write(&aem_cmd_get_stream_info, cmd_frame->payload, ETHER_HDR_SIZE, sizeof(cmd_frame->payload)); if(aem_cmd_get_stream_info_returned < 0) { log_imp_ref->post_log_msg(LOGGING_LEVEL_ERROR, "aem_cmd_get_stream_info_write error\n"); assert(aem_cmd_get_stream_info_returned >= 0); return -1; } aem_controller_state_machine_ref->common_hdr_init(cmd_frame, base_end_station_imp_ref->guid()); system_queue_tx(notification_id, CMD_WITH_NOTIFICATION, cmd_frame->payload, cmd_frame->length); free(cmd_frame); return 0; }