string

2 posts / 0 new
Last post
Offline
Last seen: 7 months 3 weeks ago
Joined: 08/28/2023
Posts: 1
8-bit clean bytearray in Python connector

Python3 str type is unicode UTF-8 by default. The bytes or bytearray types are more appropriate to communicate with a peer expecting C strings. In the Connector Python binding, there is a lot of round-tripping between C strings and UTF-8 Python str. This has the possibility of corrupting data or throwing errors when the content is not meant to be UTF-8. On top of that, those operations are slow. There are lower-level and "native" functions within Connector, but I can't find much information about their semantics and best practices.

Keywords:
6 posts / 0 new
Last post
Offline
Last seen: 1 year 3 months ago
Joined: 03/13/2022
Posts: 11
convert Enum to string and conversely

Hi

I want to convert a safe enum to string and conversely. For example I have a enum as following:

10 posts / 0 new
Last post
Offline
Last seen: 4 years 6 days ago
Joined: 09/29/2019
Posts: 8
string too long

Hi, I have a problem on DDS.

I set string lenth in idl is 65536, but when I publish data, it said: string too long, truncated to 1024.

Here is my idl struct setting, 

struct datamsg {
string<8> ID;
string<128> file_name;
string<65536> data;
long timestamp;
};

please tell me how to fix it, thanks.

Karen

Organization:
Keywords:
1 post / 0 new
jwillemsen's picture
Offline
Last seen: 2 years 10 months ago
Joined: 09/24/2013
Posts: 55
Most efficient way to copy a DDS String sequence to std::vector<std::string> and back

I am wondering what is the most efficient (but safe) way to copy a DDS String sequence (using the 'old' DDS C++ API) to a std::vector<std::string> and back? In how far can C++11 move semantics be used safely?

1 post / 0 new
Offline
Last seen: 6 years 9 months ago
Joined: 03/03/2015
Posts: 19
Send String Arrays using Dynamic Data and Request-Reply pattern

Hello,

I am a bit new to DDS. I am curently working with the request/reply pattern. I successfully managed to send requests and replies containing primitive types of data such as char, long, int, etc. What I am not trying to do is sending some string array with the request reply pattern and using Dynamic Data as the string array I'm trying to send must be custom made. Until now I managed to do something like this:

 

//Register the type support for creating string arrays

DDS_TypeCode* type = factory->create_struct_tc("MyType", structMembers, out_exc);

7 posts / 0 new
Last post
Offline
Last seen: 9 years 6 days ago
Joined: 01/14/2015
Posts: 8
Sequence - SIGABRT invalid pointer (C++)

Hi,

I'm struggling with an embedded sequence within a struct. When I try to send it, the application terminates with a SIGABRT.

Given the following IDL:

-------------------------snip-----------------------------
const long MAX_STRING_LENGTH = 256;

enum StudentStatus{
ENROLLED,
ALUMNI
};

struct Student{
string<MAX_STRING_LENGTH> name;
string<MAX_STRING_LENGTH> familyname;
StudentStatus status;
};

Keywords:
3 posts / 0 new
Last post
Offline
Last seen: 10 years 11 months ago
Joined: 05/06/2013
Posts: 2
Setting an array of strings

Given next field in a topic.

<member name="exerciseNickname"          type="string" arrayDimensions="4" stringMaxLength="20"/>

With the usual dynamicdata you have set some array types to set as double, byte, float, etc but there's no set_string_array.

Notice in my case i don't use idl file i use a file .qos to describe every topic instead.

How can i set the array of string?

Keywords:
Subscribe to RSS - string