RESTful ranges

24 views
Skip to first unread message

ferrisoxide

unread,
Nov 16, 2011, 7:17:04 AM11/16/11
to xpca
The original thread is closed and I can't figure out how to re-open
it. Starting again:

I notice that Aleksey uses a different model again in his RMobus
example mapping to XPCA. Quoting code from
https://github.com/flipback/rmodbus/blob/master/examples/simple-xpca-gateway.rb

# Calc a GET request
# @example
# http://127.0.0.1:4567/mb/127.0.0.1/8502/1/coils/6/17
#
# HTTP route: GET http://localhost/mb/:ip/:port/:slave/:dataplace/:firstaddr/:lastaddr
#
# :ip - ip addr of ModBus TCP Server
# :port - port of ModBUs TCP Server
# :slave - id of slave device
# :dataplace - valid values: coils, discrete_inputs, input_registers,
holding_registers
# :firstaddr - first addr of registers(contacts)
# :lastaddr - last addr of registers(contacts)

Here he's using /:firstaddr/:lastaddr as the way to express ranges. I
think this is natural and fits in with the general RESTful approach -
and XPCA as well.. it doesn't try to reinvent anything. It expresses
the range as simply as it can - no markup or conventions.

I vote for this approach to ranges.

flipback

unread,
Nov 16, 2011, 12:36:53 PM11/16/11
to xp...@googlegroups.com
As author of this mapping I vote too. But maybe we will design basic XPCA-spec for description of formats data (types data, timestamps, quality, exceptions and etc) before we start to design various mappings? 
I think we must have common stanart of response for any mapping. 
Reply all
Reply to author
Forward
0 new messages