Lines Matching refs:msg

120 static void hex_to_string(const char *msg, ssize_t len, char *str)  in hex_to_string()  argument
125 ptr += snprintf(ptr, 3, "%02X", msg[i]); in hex_to_string()
207 const cec_message_t* msg) in cec_send_message() argument
215 __FUNCTION__, msg->initiator, msg->destination, in cec_send_message()
216 (uint32_t) msg->length); in cec_send_message()
220 if(msg->length > 0) { in cec_send_message()
221 hex_to_string((char*)msg->body, msg->length, dump); in cec_send_message()
232 write_msg[CEC_OFFSET_SENDER_ID] = msg->initiator; in cec_send_message()
233 write_msg[CEC_OFFSET_RECEIVER_ID] = msg->destination; in cec_send_message()
235 write_msg[CEC_OFFSET_OPCODE] = msg->body[0]; in cec_send_message()
236 if(msg->length > 1) { in cec_send_message()
237 memcpy(&write_msg[CEC_OFFSET_OPERAND], &msg->body[1], in cec_send_message()
238 sizeof(char)*(msg->length - 1)); in cec_send_message()
241 write_msg[CEC_OFFSET_FRAME_LENGTH] = (unsigned char) (msg->length + 1); in cec_send_message()
280 void cec_receive_message(cec_context_t *ctx, char *msg, ssize_t len) in cec_receive_message() argument
287 hex_to_string(msg, len, dump); in cec_receive_message()
295 event.cec.length = msg[CEC_OFFSET_FRAME_LENGTH] - 1; in cec_receive_message()
296 event.cec.initiator = (cec_logical_address_t) msg[CEC_OFFSET_SENDER_ID]; in cec_receive_message()
297 event.cec.destination = (cec_logical_address_t) msg[CEC_OFFSET_RECEIVER_ID]; in cec_receive_message()
299 memcpy(event.cec.body, &msg[CEC_OFFSET_OPCODE], event.cec.length); in cec_receive_message()