コード例 #1
0
ファイル: sedp.c プロジェクト: ernestmc/freertps
void sedp_add_builtin_endpoints(frudp_part_t *part)
{
  printf("adding endpoints for ");
  frudp_print_guid_prefix(&part->guid_prefix);
  printf("\r\n");

  frudp_reader_t pub_reader; // this reads the remote peer's publications
  pub_reader.writer_guid = g_frudp_guid_unknown;
  frudp_stuff_guid(&pub_reader.writer_guid,
                   &part->guid_prefix,
                   &g_sedp_pub_writer_id);
  pub_reader.reader_eid = g_sedp_pub_reader_id;
  pub_reader.max_rx_sn.low = 0;
  pub_reader.max_rx_sn.high = 0;
  pub_reader.data_cb = frudp_sedp_rx_pub_data;
  pub_reader.msg_cb = NULL;
  pub_reader.reliable = true;
  frudp_add_reader(&pub_reader);

  frudp_reader_t sub_reader; // this reads the remote peer's subscriptions
  sub_reader.writer_guid = g_frudp_guid_unknown;
  frudp_stuff_guid(&sub_reader.writer_guid,
                   &part->guid_prefix,
                   &g_sedp_sub_writer_id);
  sub_reader.reader_eid = g_sedp_sub_reader_id;
  sub_reader.max_rx_sn.low = 0;
  sub_reader.max_rx_sn.high = 0;
  sub_reader.data_cb = frudp_sedp_rx_sub_data;
  sub_reader.msg_cb = NULL;
  sub_reader.reliable = true;
  frudp_add_reader(&sub_reader);

  // blast our SEDP data at this participant
  frudp_send_sedp_msgs(part);
}
コード例 #2
0
ファイル: part.c プロジェクト: Neuromancer2701/freertps
bool frudp_part_create(void)
{
  if (g_frudp_participant_init_complete)
  {
    printf("woah there partner. "
           "freertps currently only allows one participant.\r\n");
    return false;
  }
  FREERTPS_INFO("frudp_part_create() on domain_id %d\r\n",
                (int)g_frudp_config.domain_id);
  //g_frudp_config.domain_id = domain_id;
  if (!frudp_init_participant_id())
  {
    printf("unable to initialize participant ID\r\n");
    return false;
  }
  //frudp_generic_init();
  //frudp_disco_init();
  g_frudp_participant_init_complete = true;
  printf("prefix: ");
  frudp_print_guid_prefix(&g_frudp_config.guid_prefix);
  printf("\n");
  return true;
}