void avrcpHandleRegisterNotificationCommand(AVRCP *avrcp, const uint8 *ptr) { uint8 event = ptr[0]; if (((event >= EVENT_PLAYBACK_STATUS_CHANGED) && (event <= EVENT_PLAYER_SETTING_CHANGED)) || (event == EVENT_VOLUME_CHANGED)) { MAKE_AVRCP_MESSAGE(AVRCP_REGISTER_NOTIFICATION_IND); message->avrcp = avrcp; #ifdef AVRCP_ENABLE_DEPRECATED /* Deprecated fields will be removed later */ message->transaction = avrcp->rsp_transaction_label; #endif message->event_id = event; message->playback_interval = convertUint8ValuesToUint32(&ptr[1]); /* Store which event has been registered for. */ avrcp->registered_events |= (1<<event); /* Store the transaction label associated with the event. */ avrcp->notify_transaction_label[event-1] = avrcp->rsp_transaction_label; MessageSend(avrcp->clientTask,AVRCP_REGISTER_NOTIFICATION_IND,message); } else { avrcpSendRejectMetadataResponse(avrcp, avctp_response_not_implemented, AVRCP_REGISTER_NOTIFICATION_PDU_ID); } }
/**************************************************************************** *NAME * avrcpHandleInformCharSetCommand * *DESCRIPTION * Handle the incoming InformCharSetCommand command from CT. * *PARAMETERS * AVRCP - AVRCP Instance * ptr - Received Data in the command * packet_size - size of data ****************************************************************************/ void avrcpHandleInformCharSetCommand(AVRCP *avrcp, const uint8* ptr, uint16 packet_size) { if(isAvrcpPlayerSettingsEnabled(avrcpGetDeviceTask()) && packet_size) { Source source=0; uint16 data_offset=1; packet_size-= data_offset; if(packet_size) { if(!(source=avrcpSourceFromConstData(avrcp, ptr+data_offset, packet_size))) { packet_size=0; } } avrcpSendCommonFragmentedMetadataInd(avrcp, AVRCP_INFORM_CHARACTER_SET_IND, ptr[0], packet_size, source); } else { avrcpSendRejectMetadataResponse(avrcp, avctp_response_not_implemented, AVRCP_INFORM_CHARACTER_SET_PDU_ID); } }
/**************************************************************************** *NAME * avrcpHandleGetAppAttributeTextCommand * *DESCRIPTION * Handle the incoming GetApplicationAttributesText Command from CT. * *PARAMETERS * AVRCP - AVRCP Instance * ptr - Received Data in the command * packet_size - size of data ****************************************************************************/ void avrcpHandleGetAppAttributeTextCommand(AVRCP *avrcp, const uint8* ptr, uint16 packet_size) { Source source=0; uint16 data_offset=1; if(isAvrcpPlayerSettingsEnabled(avrcpGetDeviceTask()) && packet_size) { packet_size-= data_offset; if(packet_size) { source=avrcpSourceFromConstData(avrcp, ptr+data_offset, packet_size); if(!source) { packet_size = 0; } } avrcpSendCommonFragmentedMetadataInd(avrcp, AVRCP_GET_APP_ATTRIBUTE_TEXT_IND, ptr[0], packet_size, source); } else { avrcpSendRejectMetadataResponse(avrcp, avctp_response_not_implemented, AVRCP_GET_APP_ATTRIBUTE_TEXT_PDU_ID); } }
/**************************************************************************** *NAME * avrcpHandleGetAppValueTextCommand * *DESCRIPTION * Handle the incoming GetApplicationValueText Command from CT. * *PARAMETERS * AVRCP - AVRCP Instance * ptr - Received Data in the command * packet_size - size of data ****************************************************************************/ void avrcpHandleGetAppValueTextCommand(AVRCP *avrcp, const uint8* data, uint16 packet_size) { if(isAvrcpPlayerSettingsEnabled(avrcpGetDeviceTask()) && (packet_size > 1)) { Source source=0; uint16 data_offset=2; packet_size-= data_offset; if(packet_size) { source=avrcpSourceFromConstData(avrcp, data+data_offset, packet_size); if(!source) { packet_size=0; } } { MAKE_AVRCP_MESSAGE(AVRCP_GET_APP_VALUE_TEXT_IND); message->avrcp = avrcp; message->attribute_id = data[0]; message->number_of_attributes = data[1]; message->size_attributes = packet_size; message->attributes = source; #ifdef AVRCP_ENABLE_DEPRECATED /* Deprecated fields will be removed later */ message->metadata_packet_type = avrcp_packet_type_single; message->transaction = avrcp->rsp_transaction_label; message->no_packets = 0; message->ctp_packet_type = AVCTP0_PACKET_TYPE_SINGLE; message->data_offset = 0; #endif MessageSend(avrcp->clientTask, AVRCP_GET_APP_VALUE_TEXT_IND, message); } } else { avrcpSendRejectMetadataResponse(avrcp, avctp_response_not_implemented, AVRCP_GET_APP_VALUE_PDU_ID); } }