Hi George,

You're doing it right from the looks of what you wrote.  The .dat file should 
be sitting in the same directory as you executed in.

Are you able to successfully create a .dat file using one of the provided .json 
files (this will tell you if the problem is likely in your .json file)?

It might be worth trying to build and use the debug version (making sure that 
the json2cbor app is loading the debug version of the liboctbstack.so) and then 
seeing if the json2cbor tool is printing any error info on parsing your file.

When I run the debug version I get the following; might be useful if you run 
the debug build of the tool to compare my output to yours:

nathanhs at 
ubuntu:~/git/iotivity/out/linux/x86_64/debug/resource/csdk/security/provisioning/sample$
 json2cbor oic_svr_db_server_justworks.json oic_svr_db_server_justworks.dat
JSON File Name: oic_svr_db_server_justworks.json
CBOR File Name: oic_svr_db_server_justworks.dat
29:51.436 DEBUG: OIC_JSON2CBOR: Read 2985 bytes
29:51.436 DEBUG: OIC_SRM_ACL: AclToCBORPayload Successed
ACL Cbor Size: 625
IN JSONToPstatBin
29:51.436 INFO: OIC_JSON2CBOR: Using pstat with mandatory .dos object.
29:51.436 INFO: OIC_JSON2CBOR: pstat.dos object found in jsonPstat
29:51.436 INFO: OIC_JSON2CBOR: pstat.dos.s object found in jsonDos
29:51.436 INFO: OIC_JSON2CBOR: pstat.dos.s = 1
29:51.436 INFO: OIC_JSON2CBOR: pstat.dos.p object found in jsonDos
29:51.436 INFO: OIC_JSON2CBOR: pstat.dos.p = false
OUT JSONToPstatBin: success
29:51.436 INFO: OIC_SRM_PSTAT: PstatToCBORPayloadPartial: creating pstat CBOR 
payload with 7 Properties.
29:51.436 DEBUG: OIC_SRM_PSTAT: PstatToCBORPayloadPartial: including dos 
Property.
29:51.436 DEBUG: OIC_SRM_PSTAT: PstatToCBORPayloadPartial: including isop 
Property.
29:51.436 DEBUG: OIC_SRM_PSTAT: PstatToCBORPayloadPartial: including cm 
Property.
29:51.436 DEBUG: OIC_SRM_PSTAT: PstatToCBORPayloadPartial: including tm 
Property.
29:51.436 DEBUG: OIC_SRM_PSTAT: PstatToCBORPayloadPartial: including om 
Property.
29:51.436 DEBUG: OIC_SRM_PSTAT: PstatToCBORPayloadPartial: including sm 
Property.
29:51.436 DEBUG: OIC_SRM_PSTAT: PstatToCBORPayloadPartial: including rowneruuid 
Property.
PSTAT Cbor Size: 119
IN JSONToDoxmBin
29:51.436 INFO: OIC_SRM_UTILITY: Converting empty UUID string to 
00000000-0000-0000-0000-000000000000
OUT JSONToDoxmBin: success
DOXM Cbor Size: 213
Total Cbor Size : 957
29:51.436 DEBUG: OIC_JSON2CBOR: Payload size 981
29:51.436 DEBUG: OIC_JSON2CBOR: Written 981 bytes



From: iotivity-dev-bounces at lists.iotivity.org 
[mailto:[email protected]] On Behalf Of Nash, George
Sent: Tuesday, April 25, 2017 4:26 PM
To: iotivity-dev at lists.iotivity.org
Subject: [dev] help using cbor2json

I have been trying to get an understanding of IoTivity provisioning.

To test my understanding I decided to mess with the ACLs for the simpleserver 
simpleclient samples.  So I modified the oic_svr_db_server.json file with some 
different values.

I deleted the already existing oic_svr_db_server.dat file and then ran

./json2cbor my_modified_acl.json oic_svr_db_server.dat

It outputs
JSON file Name: my_modified_acl.json
CBOR file Name: oic_svr_db_server.dat

Now I can't find the output oic_svr_db_server.dat

I am not sure why I cannot find the output file am I doing something wrong?

George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20170426/1fb9e462/attachment.html>

Reply via email to