void acmp_tx_state_avail( uint64_t tarker_entity_id, uint16_t tarker_unique_id )
{
	struct jdksavdecc_acmpdu acmp_cmd_get_tx_state;
	struct jdksavdecc_frame frame;
	acmp_frame_init_2( &frame );
	
        jdksavdecc_eui64_init( &acmp_cmd_get_tx_state.listener_entity_id );
        jdksavdecc_uint64_write( tarker_entity_id, &acmp_cmd_get_tx_state.talker_entity_id, 0, sizeof(uint64_t) );
        acmp_cmd_get_tx_state.talker_unique_id = tarker_unique_id;
        jdksavdecc_eui48_init(&acmp_cmd_get_tx_state.stream_dest_mac);

	acmp_form_msg( &frame, &acmp_cmd_get_tx_state,  JDKSAVDECC_ACMP_MESSAGE_TYPE_GET_TX_STATE_COMMAND, \
		acmp_sequence_id++,  acmp_cmd_get_tx_state.talker_entity_id, tarker_unique_id, acmp_cmd_get_tx_state.listener_entity_id, 0,\
		0 );
	
	system_raw_packet_tx( frame.dest_address.value, frame.payload, frame.length, RUNINFLIGHT, TRANSMIT_TYPE_ACMP, false);
}
    int STDCALL stream_input_descriptor_imp::send_get_rx_state_cmd(void *notification_id)
    {
        struct jdksavdecc_frame *cmd_frame;
        struct jdksavdecc_acmpdu acmp_cmd_get_rx_state;
        int acmp_cmd_get_rx_state_returned;
        uint64_t listener_guid = base_end_station_imp_ref->get_entity_desc_by_index(0)->entity_id();

        cmd_frame = (struct jdksavdecc_frame *)malloc(sizeof(struct jdksavdecc_frame));

        /******************************************* ACMP Common Data ******************************************/
        acmp_cmd_get_rx_state.controller_entity_id = base_end_station_imp_ref->get_adp()->get_controller_guid();
        jdksavdecc_eui64_init(&acmp_cmd_get_rx_state.talker_entity_id);
        jdksavdecc_uint64_write(listener_guid, &acmp_cmd_get_rx_state.listener_entity_id, 0, sizeof(uint64_t));
        acmp_cmd_get_rx_state.talker_unique_id = 0;
        acmp_cmd_get_rx_state.listener_unique_id = descriptor_index();
        jdksavdecc_eui48_init(&acmp_cmd_get_rx_state.stream_dest_mac);
        acmp_cmd_get_rx_state.connection_count = 0;
        // Fill acmp_cmd_get_rx_state.sequence_id in AEM Controller State Machine
        acmp_cmd_get_rx_state.flags = 0;
        acmp_cmd_get_rx_state.stream_vlan_id = 0;

        /*************** Fill frame payload with AECP data and send the frame ***************/
        acmp_controller_state_machine_ref->ether_frame_init(cmd_frame);
        acmp_cmd_get_rx_state_returned = jdksavdecc_acmpdu_write(&acmp_cmd_get_rx_state,
                                                                 cmd_frame->payload,
                                                                 ETHER_HDR_SIZE,
                                                                 sizeof(cmd_frame->payload));

        if(acmp_cmd_get_rx_state_returned < 0)
        {
            log_imp_ref->post_log_msg(LOGGING_LEVEL_ERROR, "cmd_get_rx_state_write error\n");
            assert(acmp_cmd_get_rx_state_returned >= 0);
            return -1;
        }

        acmp_controller_state_machine_ref->common_hdr_init(JDKSAVDECC_ACMP_MESSAGE_TYPE_GET_RX_STATE_COMMAND, cmd_frame);
        system_queue_tx(notification_id, CMD_WITH_NOTIFICATION, cmd_frame->payload, cmd_frame->length);

        free(cmd_frame);
        return 0;
    }
int STDCALL stream_input_descriptor_imp::send_disconnect_rx_cmd(void * notification_id, uint64_t talker_entity_id, uint16_t talker_unique_id)
{
    entity_descriptor_response * entity_resp_ref = base_end_station_imp_ref->get_entity_desc_by_index(0)->get_entity_response();
    struct jdksavdecc_frame cmd_frame;
    struct jdksavdecc_acmpdu acmp_cmd_disconnect_rx;
    ssize_t acmp_cmd_disconnect_rx_returned;
    uint64_t listener_entity_id = entity_resp_ref->entity_id();

    /******************************************* ACMP Common Data *******************************************/
    acmp_cmd_disconnect_rx.controller_entity_id = base_end_station_imp_ref->get_adp()->get_controller_entity_id();
    jdksavdecc_uint64_write(talker_entity_id, &acmp_cmd_disconnect_rx.talker_entity_id, 0, sizeof(uint64_t));
    jdksavdecc_uint64_write(listener_entity_id, &acmp_cmd_disconnect_rx.listener_entity_id, 0, sizeof(uint64_t));
    acmp_cmd_disconnect_rx.talker_unique_id = talker_unique_id;
    acmp_cmd_disconnect_rx.listener_unique_id = descriptor_index();
    jdksavdecc_eui48_init(&acmp_cmd_disconnect_rx.stream_dest_mac);
    acmp_cmd_disconnect_rx.connection_count = 0;
    // Fill acmp_cmd_disconnect_rx.sequence_id in AEM Controller State Machine
    acmp_cmd_disconnect_rx.flags = 0;
    acmp_cmd_disconnect_rx.stream_vlan_id = 0;

    /**************** Fill frame payload with AECP data and send the frame ***************/
    acmp_controller_state_machine_ref->ether_frame_init(&cmd_frame);
    acmp_cmd_disconnect_rx_returned = jdksavdecc_acmpdu_write(&acmp_cmd_disconnect_rx,
                                                              cmd_frame.payload,
                                                              ETHER_HDR_SIZE,
                                                              sizeof(cmd_frame.payload));

    if (acmp_cmd_disconnect_rx_returned < 0)
    {
        log_imp_ref->post_log_msg(LOGGING_LEVEL_ERROR, "cmd_disconnect_rx_write error\n");
        assert(acmp_cmd_disconnect_rx_returned >= 0);
        return -1;
    }

    acmp_controller_state_machine_ref->common_hdr_init(JDKSAVDECC_ACMP_MESSAGE_TYPE_DISCONNECT_RX_COMMAND, &cmd_frame);
    system_queue_tx(notification_id, CMD_WITH_NOTIFICATION, cmd_frame.payload, cmd_frame.length);

    delete entity_resp_ref;
    return 0;
}
Beispiel #4
0
 ///
 /// \brief Eui48 constructor
 ///
 /// Initialize all octets to 0xff
 ///
 Eui48() {
     jdksavdecc_eui48_init( this );
 }
Beispiel #5
0
 void clear() {
     jdksavdecc_eui48_init( this );
 }