Skip to content

Commit

Permalink
Support for RAINS tagged data
Browse files Browse the repository at this point in the history
See https://britram.github.io/rains-prototype/ for more information on
RAINS.
  • Loading branch information
spc476 committed Oct 5, 2016
1 parent 92a61dd commit c6b3068
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
13 changes: 13 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

1.1.0 2016-10-04

* Added support for RAINS tagging
(see https://britram.github.io/rains-prototype/)

1.0.1 2016-06-26

* Bug fixes to Makefile.

1.0.0 2016-04-04

* Initial version of CBOR.
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ types are:
* _decimalfractionexp like _decimalfraction, non-int exponent
* _bigfloatexp like _bigfloat, non-int exponent
* _indirection Indirection
* _rains RAINS based message

--------------------------------------------------------------

Expand Down
11 changes: 11 additions & 0 deletions cbor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
-- * _decimalfractionexp like _decimalfraction, non-int exponent
-- * _bigfloatexp like _bigfloat, non-int exponent
-- * _indirection Indirection
-- * _rains RAINS message
-- *** Lua CBOR library types
-- * __error error parsing (TEXT)
-- data (any) decoded CBOR data
Expand Down Expand Up @@ -1118,6 +1119,16 @@ TAG = setmetatable(
local value,npos = decode(packet,pos,conv,ref)
return value,npos,'_indirection'
end,

-- =====================================================================

_rains = function()
return cbor_c.encode(0xC0,15309736)
end,

[15309736] = function(_,pos)
return '_rains',pos,'_rains'
end,
},
{
__index = function(_,key)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package = "org.conman.cbor"
version = "1.0.1-1"
version = "1.1.0-1"

source =
{
url = "git://github.com/spc476/CBOR.git",
tag = "1.0.1"
tag = "1.1.0"
}

description =
Expand Down
3 changes: 3 additions & 0 deletions test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -631,3 +631,6 @@ local hoade2 = { first = "Sean" , last = "Hoade" , occupation = "writer" }
local conner2 = { first = "Sean" , last = "Conner" , occupation = "programmer" }
local array2 = { hoade2 , hoade2 , hoade2 , conner2 , conner2 , conner2 }
rtst('ARRAY',array2,nil,{},{})

test('_rains',"DA00E99BA8","_rains",
function() return cbor.TAG._rains() end)

0 comments on commit c6b3068

Please sign in to comment.