Skip to content

Instantly share code, notes, and snippets.

@tatey tatey/0_type.cr
Created Aug 21, 2015

Embed
What would you like to do?
enum Type : UInt16
DeviceGetService = 2
DeviceStateService
DeviceGetPower = 20
DeviceSetPower
DeviceStatePower
def c_struct
{% if true %}
case self
{% for value in @constants %}
when {{value}}
C::LX{{value}}
{% end %}
end
{% end %}
end
end
alias LXDeviceGetPower = Nil
@[Packed]
struct LXDeviceStateService
service : UInt8
port : UInt32
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.