DDS_ReturnCode_t DDS_BytesDataWriter_write_w_timestamp (DDS_DataWriter dw, const DDS_Bytes *data, const DDS_InstanceHandle_t h, const DDS_Time_t *time) { return (DDS_DataWriter_write_w_timestamp (dw, data, h, time)); }
DDS_ReturnCode_t DDS_StringDataWriter_write_w_timestamp (DDS_DataWriter dw, const char *data, const DDS_InstanceHandle_t h, const DDS_Time_t *time) { DDS_String s; s.value = (char *) data; return (DDS_DataWriter_write_w_timestamp (dw, &s, h, time)); }
DDS_ReturnCode_t DDS_KeyedStringDataWriter_write_string_w_key_w_timestamp( DDS_DataWriter dw, const char *key, const char *str, const DDS_InstanceHandle_t h, const DDS_Time_t *time) { DDS_KeyedString ks; ks.key = (char *) key; ks.value = (char *) str; return (DDS_DataWriter_write_w_timestamp (dw, &ks, h, time)); }
int dds_write_ts ( dds_entity_t wr, const void *data, dds_time_t timestamp) { DDS_ReturnCode_t result; DDS_Time_t ts = dds_time_to_sac(timestamp); DDS_REPORT_STACK(); result = DDS_DataWriter_write_w_timestamp(wr, (const DDS_Sample)data, DDS_HANDLE_NIL, &ts); DDS_REPORT_FLUSH(wr, result != DDS_RETCODE_OK); return DDS_ERRNO(result, DDS_MOD_WRITER, DDS_ERR_Mx); }
DDS_ReturnCode_t DDS_BytesDataWriter_write_w_bytes_w_timestamp ( DDS_DataWriter dw, const unsigned char *bytes, int offset, int length, const DDS_InstanceHandle_t h, const DDS_Time_t *time) { DDS_Bytes bs; bs.value._maximum = bs.value._length = length; bs.value._esize = 1; bs.value._own = 1; bs.value._buffer = (unsigned char *) bytes + offset; return (DDS_DataWriter_write_w_timestamp (dw, &bs, h, time)); }
void ctt_send (Domain_t *dp, Participant_t *pp, Endpoint_t *sep, Endpoint_t *dep, DDS_ParticipantVolatileSecureMessage *msg) { Writer_t *wp; DDS_Time_t time; DDS_InstanceHandleSeq handles; DDS_InstanceHandle_t h; int error; CTT_ASSERT (dp); memcpy (msg->message_identity.source_guid, dp->participant.p_guid_prefix.prefix, 12); msg->message_identity.sequence_number = psmp_seqnr++; if (pp) memcpy (msg->destination_participant_key, pp->p_guid_prefix.prefix, 12); if (dep) { memcpy (msg->destination_endpoint_key, pp->p_guid_prefix.prefix, 12); memcpy (msg->destination_endpoint_key + 12, dep->entity_id.id, 4); memcpy (msg->source_endpoint_key, dp->participant.p_guid_prefix.prefix, 12); memcpy (msg->source_endpoint_key + 12, sep->entity_id.id, 4); } CTT_TRACE ('T', msg); wp = (Writer_t *) dp->participant.p_builtin_ep [EPB_PARTICIPANT_VOL_SEC_W]; /* Send participant data. */ if (pp) { DDS_SEQ_INIT (handles); h = pp->p_builtin_ep [EPB_PARTICIPANT_VOL_SEC_R]->entity.handle; DDS_SEQ_LENGTH (handles) = DDS_SEQ_MAXIMUM (handles) = 1; DDS_SEQ_DATA (handles) = &h; sys_gettime ((Time_t *) &time); error = DDS_DataWriter_write_w_timestamp_directed (wp, msg, 0, &time, &handles); if (error) fatal_printf ("ctt_send: error sending crypto tokens message!"); } else { sys_gettime ((Time_t *) &time); error = DDS_DataWriter_write_w_timestamp (wp, msg, 0, &time); if (error) fatal_printf ("ctt_send: error sending crypto tokens message!"); } CTT_ASSERT (dp); }
DDS_ReturnCode_t DDS_KeyedBytesDataWriter_write_bytes_w_key_w_timestamp( DDS_DataWriter dw, const char *key, const unsigned char *bytes, int offset, int length, const DDS_InstanceHandle_t h, const DDS_Time_t *time) { DDS_KeyedBytes kb; kb.key = (char *) key; kb.value._length = kb.value._maximum = length; kb.value._esize = 1; kb.value._own = 1; kb.value._buffer = (unsigned char *) bytes + offset; return (DDS_DataWriter_write_w_timestamp (dw, &kb, h, time)); }
int msg_send_liveliness (Domain_t *dp, unsigned kind) { ParticipantMessageData msgd; Writer_t *wp; DDS_Time_t time; int error; if (!domain_ptr (dp, 1, (DDS_ReturnCode_t *) &error)) return (error); msgd.participantGuidPrefix = dp->participant.p_guid_prefix; wp = (Writer_t *) dp->participant.p_builtin_ep [EPB_PARTICIPANT_MSG_W]; lock_release (dp->lock); msgd.kind [0] = msgd.kind [1] = msgd.kind [2] = 0; if (kind == 0) /* Automatic mode. */ msgd.kind [3] = 1; else if (kind == 1) /* Manual mode. */ msgd.kind [3] = 2; else msgd.kind [3] = 0; msgd.data._length = msgd.data._maximum = 0; msgd.data._esize = 1; msgd.data._own = 1; msgd.data._buffer = NULL; sys_gettime ((Time_t *) &time); error = DDS_DataWriter_write_w_timestamp (wp, &msgd, 0, &time); #ifdef DISC_MSG_DUMP /* Message to remote participant. */ if (spdp_log) msg_data_info (&dp->participant, &msgd, 'T', 0); #endif return (error); }