Giter Club home page Giter Club logo

liblifx's Introduction

liblifx

LIFX device application library

Build

mkdir build cd build cmake .. make

liblifx's People

Contributors

gladish avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

liblifx's Issues

valgrind reporting unitialized bytes sent

1582595558.856188 INFO -- Thread-9882: header:42 write_buffer:1076
==9882== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
==9882== at 0x5174DFA: sendto (sendto.c:27)
==9882== by 0x4E4D763: lifxSession_SendToInternal (lifx_session.c:456)
==9882== by 0x4E4E03C: lifxSession_BeginSendRequest (lifx_session.c:666)
==9882== by 0x108D26: main (async.c:67)
==9882== Address 0x586b386 is 38 bytes inside a block of size 1,076 alloc'd
==9882== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9882== by 0x4E423BD: lifxBuffer_Init (lifx_buffer.c:35)
==9882== by 0x4E4C962: lifxSession_Open (lifx_session.c:160)
==9882== by 0x108C87: main (async.c:50)
==9882==

code generator should use char instead of uint8_t for strings

// {'name': 'Label', 'type': '[32]byte', 'size_bytes': 32}
uint8_t Label[32];

it looks like all places where [n]byte is used is a string. should just make that
char Label[32];

otherwise you have to cast when passing into strcpy() and friends.

Code generator broken on array of structs

// {'name': 'Palette', 'type': '[16]', 'size_bytes': 128}

that didn't parse properly. it generated

lifxLightHsbk_t Palette;

should be

lifxLightHsbk_t Palette[16];

background thread not shutdown during session close

==9882==
==9882== HEAP SUMMARY:
==9882== in use at exit: 5,288 bytes in 6 blocks
==9882== total heap usage: 12 allocs, 6 frees, 12,032 bytes allocated
==9882==
==9882== 272 bytes in 1 blocks are possibly lost in loss record 2 of 5
==9882== at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9882== by 0x40134A6: allocate_dtv (dl-tls.c:286)
==9882== by 0x40134A6: _dl_allocate_tls (dl-tls.c:530)
==9882== by 0x544B227: allocate_stack (allocatestack.c:627)
==9882== by 0x544B227: pthread_create@@GLIBC_2.2.5 (pthread_create.c:644)
==9882== by 0x4E42348: lifxThread_Create (lifx.c:260)
==9882== by 0x4E4CAF8: lifxSession_Open (lifx_session.c:196)
==9882== by 0x108C87: main (async.c:50)
==9882==
==9882== LEAK SUMMARY:
==9882== definitely lost: 0 bytes in 0 blocks
==9882== indirectly lost: 0 bytes in 0 blocks
==9882== possibly lost: 272 bytes in 1 blocks
==9882== still reachable: 5,016 bytes in 5 blocks
==9882== suppressed: 0 bytes in 0 blocks
==9882== Reachable blocks (those to which a pointer was found) are not shown.
==9882== To see them, rerun with: --leak-check=full --show-leak-kinds=all

[PORTABILITY] LIFX_EXPORT macros

#define LIFX_EXPORT attribute ((visibility ("default")))
#define LIFX_IMPORT attribute ((visibility ("hidden")))

Need to replace this with something compatible with windows declspec import/export.

single lifx_protocol.h and .c

The code generator should just create a single lifx_protocol.h and lifx_protocol.c. There's no reason to have a bunch.

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.