Hacker Newsnew | past | comments | ask | show | jobs | submit | cjhdev's commentslogin

I think this depends on the region. In the US you shouldn't exceed a dwell time limit on a single channel.


I have been improving a Ruby gem that I think would be useful for building web connected sensor applications (IoT stuff) in a hurry.

The tool implements a serialisation spec called The Blink Protocol. The spec is similar to Google Protobufs with a few differences, mainly:

- It's more compact on the wire (important for LPWAN)

- It's minimalistic and has a proper specification document

The gem implements a schema parser, a dynamic message class generator, and an extensible codec generator.

The idea is you can use the tool for both ends of your application:

- Use the codec generator to generate C source for your device

- Use the dynamic message class in your web app to consume messages

On the Ruby side it should be as easy to use as JSON.

https://github.com/cjhdev/slow_blink


This is an example of using Flex and Bison to generate a parser that can be packaged up as a Ruby extension. The subject is JSON because it's LALR compatible and easily recognisable.

I've used this technique to produce tools that parse syntax other than JSON. I think it's neat because Flex/Bison is very mature, it works well the the Ruby C API, and the parser produced is self contained (i.e. no runtime components).


I've learned a lot about LALR and GLR using Bison in combination with Ruby.

Bison and Flex are available as apt packages on Ubuntu and there is heaps of documentation.

The Ruby angle means you don't have to roll your own AST structures. Also, Ruby's 'VALUE' type is easily passed around in Bison grammar.

example:

https://github.com/cjhdev/slow_blink/blob/master/etc/slow_bl...


SEEKING WORK - UK / Remote

Embedded software developer with background in smart meter product development.

  - Requirements capture, solution design, task decomposition, documentation
  - C, MISRA C, C++, Ruby
  - M2M protocols, especially those in the domain of smart metering (DLMS/COSEM, GBCS)
  - Automation with Jenkins and Ansible
email: [email protected]

linkedin: https://uk.linkedin.com/in/cameronisanengineer


SEEKING WORK - UK / Remote

Embedded software developer with background in smart meter product development.

  - Requirements capture, solution design, task decomposition, documentation
  - C, MISRA C, C++, Ruby
  - M2M protocols, especially those in the domain of smart metering (DLMS/COSEM, GBCS)
  - Automation with Jenkins and Ansible
email: [email protected]

linkedin: https://uk.linkedin.com/in/cameronisanengineer


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: