Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Californium compliance to CBoR RFC 7049 #663

Closed
jas-singh14 opened this issue Jun 15, 2018 · 10 comments
Closed

Californium compliance to CBoR RFC 7049 #663

jas-singh14 opened this issue Jun 15, 2018 · 10 comments
Assignees
Labels

Comments

@jas-singh14
Copy link

Please let us know compliance of Californium w.r.t RFC 7049 (CBOR support).

@sophokles73
Copy link
Contributor

what is to support?

@sophokles73 sophokles73 self-assigned this Jun 15, 2018
@jas-singh14
Copy link
Author

Does Cf provides functionality of CBOR encoding/decoding OR we need to find an separate library for supporting CBOR encoding/decoding functionality?

@boaks
Copy link
Contributor

boaks commented Jun 15, 2018

Though payload format is not the scope of californium, it's not provided with californium.
We also do not provided an XML parser nor JSON support (even if some examples import a JSON library).
We also do not mention that functionality in the page, I provided the links already in your other question #661

@jas-singh14
Copy link
Author

Any suggestions for the CBOR library? As of now we are evaluating two libraries peteroupc library(https://github.com/peteroupc/CBOR-Java) and c-rack library(https://github.com/c-rack/cbor-java)?
Also do these libraries interoperate (client from one library can talk to server with another library)?
I know this is not Cf question per-se, but probably you can answer based on past experience/expertise.
Thanks in advance.

@boaks
Copy link
Contributor

boaks commented Jun 15, 2018

I personally have no experience with CBOR but I would recommend then to change the title asking for a CBOR java implementation recommendation, or even better, close this issue and create a new one.

@jas-singh14
Copy link
Author

thanks for the valuable inputs. I am closing this..

@jiangyoudi
Copy link

Dear,
CBOR not support, but MediaTypeRegistry has the fllowing type ,what's used to do?

CoapResponse resp = client.post(payload, MediaTypeRegistry.APPLICATION_JSON);
CoapResponse resp = client.post(payload, MediaTypeRegistry.APPLICATION_CBOR);
CoapResponse resp = client.post(payload, MediaTypeRegistry.APPLICATION_VND_OMA_LWM2M_TLV);

@boaks boaks reopened this Jan 22, 2019
@boaks
Copy link
Contributor

boaks commented Jan 22, 2019

Dear,
CBOR not support, but MediaTypeRegistry has the fllowing type ,what's used to do?

Sorry, there is is general misunderstanding in the "responsibilities". Californium offer the transport of payload as bytes, the encoding and decoding of these bytes is the responsibility of the application layer on the top of californium. There are plenty media types registered at iana (see https://www.iana.org/assignments/media-types/media-types.xhtml) and support them all with encoding/decoding doesn't make sense.

e.g.:
If you application want to use JSON, you may just import the json parser and serializer of your choice and use that to encoding and decoding your JSON into or from bytes. For the cf-extplugtest-server/client we import google's json parser as "pom dependency".

<dependency>
  <groupId>com.google.code.gson</groupId>
  <artifactId>gson</artifactId>
  <version>2.8.2</version>
</dependency>

In the meantime, the ri.se has spent a OSCORE implementation, which uses CBOR on it's own. Therefore that OSCORE module imports

<dependency>
  <groupId>com.upokecenter</groupId>
  <artifactId>cbor</artifactId>
  <version>3.0.3</version>
</dependency>

If you want to use the OSCORE module, you may also use that CBOR implementation, if the license of that implementation fits your requirements. General, you free to chose your parser/serializer.

Does this answer help you to understand, what californium does for you, and what must be done by yourself?

@jiangyoudi
Copy link

Dear,
CBOR not support, but MediaTypeRegistry has the fllowing type ,what's used to do?

Sorry, there is is general misunderstanding in the "responsibilities". Californium offer the transport of payload as bytes, the encoding and decoding of these bytes is the responsibility of the application layer on the top of californium. There are plenty media types registered at iana (see https://www.iana.org/assignments/media-types/media-types.xhtml) and support them all with encoding/decoding doesn't make sense.

e.g.:
If you application want to use JSON, you may just import the json parser and serializer of your choice and use that to encoding and decoding your JSON into or from bytes. For the cf-extplugtest-server/client we import google's json parser as "pom dependency".

<dependency>
  <groupId>com.google.code.gson</groupId>
  <artifactId>gson</artifactId>
  <version>2.8.2</version>
</dependency>

In the meantime, the ri.se has spent a OSCORE implementation, which uses CBOR on it's own. Therefore that OSCORE module imports

<dependency>
  <groupId>com.upokecenter</groupId>
  <artifactId>cbor</artifactId>
  <version>3.0.3</version>
</dependency>

If you want to use the OSCORE module, you may also use that CBOR implementation, if the license of that implementation fits your requirements. General, you free to chose your parser/serializer.

Does this answer help you to understand, what californium does for you, and what must be done by yourself?

Thand for

Dear,
CBOR not support, but MediaTypeRegistry has the fllowing type ,what's used to do?

Sorry, there is is general misunderstanding in the "responsibilities". Californium offer the transport of payload as bytes, the encoding and decoding of these bytes is the responsibility of the application layer on the top of californium. There are plenty media types registered at iana (see https://www.iana.org/assignments/media-types/media-types.xhtml) and support them all with encoding/decoding doesn't make sense.

e.g.:
If you application want to use JSON, you may just import the json parser and serializer of your choice and use that to encoding and decoding your JSON into or from bytes. For the cf-extplugtest-server/client we import google's json parser as "pom dependency".

<dependency>
  <groupId>com.google.code.gson</groupId>
  <artifactId>gson</artifactId>
  <version>2.8.2</version>
</dependency>

In the meantime, the ri.se has spent a OSCORE implementation, which uses CBOR on it's own. Therefore that OSCORE module imports

<dependency>
  <groupId>com.upokecenter</groupId>
  <artifactId>cbor</artifactId>
  <version>3.0.3</version>
</dependency>

If you want to use the OSCORE module, you may also use that CBOR implementation, if the license of that implementation fits your requirements. General, you free to chose your parser/serializer.

Does this answer help you to understand, what californium does for you, and what must be done by yourself?

Thanks for your help,I get it.Have a good day for you~~~

@boaks
Copy link
Contributor

boaks commented Jan 22, 2019

your welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants