コード例 #1
0
static void append_tag_response(fifo_t* fifo, uint8_t tag_id, bool eop, bool error) {
  // fill response with tag response
  uint8_t op_return_tag = ALP_OP_RETURN_TAG | (eop << 7);
  op_return_tag |= (error << 6);
  error_t err = fifo_put_byte(fifo, op_return_tag); assert(err == SUCCESS);
  err = fifo_put_byte(fifo, tag_id); assert(err == SUCCESS);
}
コード例 #2
0
void alp_append_return_file_data_action(fifo_t* fifo, uint8_t file_id, uint32_t offset, uint32_t length, uint8_t* data) {
  assert(fifo_put_byte(fifo, ALP_OP_RETURN_FILE_DATA) == SUCCESS);
  assert(fifo_put_byte(fifo, file_id) == SUCCESS);
  alp_append_length_operand(fifo, offset);
  alp_append_length_operand(fifo, length);
  assert(fifo_put(fifo, data, length) == SUCCESS);
}
コード例 #3
0
void alp_append_write_file_data_action(fifo_t* fifo, uint8_t file_id, uint32_t offset, uint32_t length, uint8_t* data, bool resp, bool group) {
  uint8_t op = ALP_OP_WRITE_FILE_DATA | (resp << 6) | (group << 7);
  assert(fifo_put_byte(fifo, op) == SUCCESS);
  alp_append_file_offset_operand(fifo, file_id, offset);
  alp_append_length_operand(fifo, length);
  assert(fifo_put(fifo, data, length) == SUCCESS);
}
コード例 #4
0
void alp_append_forward_action(fifo_t* fifo, d7ap_master_session_config_t* session_config) {
  assert(session_config);
  assert(fifo_put_byte(fifo, ALP_OP_FORWARD) == SUCCESS);
  assert(fifo_put_byte(fifo, ALP_ITF_ID_D7ASP) == SUCCESS);
  assert(fifo_put_byte(fifo, session_config->qos.raw) == SUCCESS);
  assert(fifo_put_byte(fifo, session_config->dormant_timeout) == SUCCESS);
  assert(fifo_put_byte(fifo, session_config->addressee.ctrl.raw) == SUCCESS);
  uint8_t id_length = alp_addressee_id_length(session_config->addressee.ctrl.id_type);
  assert(fifo_put_byte(fifo, session_config->addressee.access_class) == SUCCESS);
  assert(fifo_put(fifo, session_config->addressee.id, id_length) == SUCCESS);
  DPRINT("FORWARD");
}
コード例 #5
0
static void rx_cb(uint8_t byte) {
  fifo_put_byte(&rx_fifo, byte);
  if(!sched_is_scheduled(&process_rx_fifo))
    sched_post_task_prio(&process_rx_fifo, MAX_PRIORITY, NULL);
}
コード例 #6
0
void alp_append_file_offset_operand(fifo_t* fifo, uint8_t file_id, uint32_t offset) {
  assert(fifo_put_byte(fifo, file_id) == SUCCESS);
  alp_append_length_operand(fifo, offset);
}
コード例 #7
0
void alp_append_tag_request_action(fifo_t* fifo, uint8_t tag_id, bool eop) {
  DPRINT("append tag %i", tag_id);
  uint8_t op = ALP_OP_REQUEST_TAG | (eop << 7);
  assert(fifo_put_byte(fifo, op) == SUCCESS);
  assert(fifo_put_byte(fifo, tag_id) == SUCCESS);
}
コード例 #8
0
static void add_interface_status_action(fifo_t* alp_response_fifo, d7ap_session_result_t* d7asp_result)
{
  fifo_put_byte(alp_response_fifo, ALP_OP_RETURN_STATUS + (1 << 6));
  fifo_put_byte(alp_response_fifo, ALP_ITF_ID_D7ASP);
  fifo_put_byte(alp_response_fifo, d7asp_result->channel.channel_header_raw);
  uint16_t center_freq_index_be = __builtin_bswap16(d7asp_result->channel.center_freq_index);
  fifo_put(alp_response_fifo, (uint8_t*)&center_freq_index_be, 2);
  fifo_put_byte(alp_response_fifo, d7asp_result->rx_level);
  fifo_put_byte(alp_response_fifo, d7asp_result->link_budget);
  fifo_put_byte(alp_response_fifo, d7asp_result->target_rx_level);
  fifo_put_byte(alp_response_fifo, d7asp_result->status.raw);
  fifo_put_byte(alp_response_fifo, d7asp_result->fifo_token);
  fifo_put_byte(alp_response_fifo, d7asp_result->seqnr);
  fifo_put_byte(alp_response_fifo, d7asp_result->response_to);
  fifo_put_byte(alp_response_fifo, d7asp_result->addressee.ctrl.raw);
  fifo_put_byte(alp_response_fifo, d7asp_result->addressee.access_class);
  uint8_t address_len = alp_addressee_id_length(d7asp_result->addressee.ctrl.id_type);
  fifo_put(alp_response_fifo, d7asp_result->addressee.id, address_len);
}