Giter Site home page Giter Site logo

Comments (1)

r00t- avatar r00t- commented on September 24, 2024

i suggest you check your code against sml_server from the examples directory.

for example, sml_server removes the 8-byte preamble and suffix before passing the datagram to sml_file_parse():
https://github.com/volkszaehler/libsml/blob/master/examples/sml_server.c#L91

	// the buffer contains the whole message, with transport escape sequences.
	// these escape sequences are stripped here.
	sml_file *file = sml_file_parse(buffer + 8, buffer_len - 16);

while your data is a whole message (which you try to pass to sml_file_parse),
which sml_server reads just fine:

$ php -r 'echo hex2bin("1b1b1b1b01010101760700110bf402df620062007263010176010107001103c500f50b0901454d4800007514c401016375f300760700110bf402e0620062007263070177010b0901454d4800007514c4070100620affff7262016503c5853c7a77078181c78203ff0101010104454d480177070100000009ff010101010b0901454d4800007514c40177070100010800ff6401018201621e52ff5600051bdfde0177070100020800ff6401018201621e52ff5600000006070177070100010801ff0101621e52ff5600051bdfde0177070100020801ff0101621e52ff5600000006070177070100010802ff0101621e52ff5600000000000177070100020802ff0101621e52ff5600000000000177070100100700ff0101621b52ff55000014f40177078181c78205ff010101018302957c486aaf8c92a257ec681e215fddeff32a2dbf2c8a88721777f5f01e5ed5ccaa694dd48c14dc5589d28e0c5b9ce88e01010163b4c800760700110bf402e362006200726302017101634e85001b1b1b1b1a000337");'  | ./sml_server -
129-129:199.130.3*255#EMH#
1-0:0.0.9*255#09 01 45 4d 48 00 00 75 14 c4 #
1-0:1.8.0*255#8571286.2#Wh
1-0:2.8.0*255#154.3#Wh
1-0:1.8.1*255#8571286.2#Wh
1-0:2.8.1*255#154.3#Wh
1-0:1.8.2*255#0.0#Wh
1-0:2.8.2*255#0.0#Wh
1-0:16.7.0*255#536.4#W
129-129:199.130.5*255#95 7c 48 6a af 8c 92 a2 57 ec 68 1e 21 5f dd ef f3 2a 2d bf 2c 8a 88 72 17 77 f5 f0 1e 5e d5 cc aa 69 4d d4 8c 14 dc 55 89 d2 8e 0c 5b 9c e8 8e #

from libsml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.