-
-
Save gr33n7007h/651ef33ff52b573612473a375cf49085 to your computer and use it in GitHub Desktop.
fiddle struct
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fiddle' | |
require 'fiddle/import' | |
# C Struct E.g. | |
# | |
# typedef struct { | |
# uint8_t b[6]; | |
# } bdaddr_t; | |
# | |
# typedef struct { | |
# bdaddr_t bdaddr;w | |
# uint8_t pscan_rep_mode; | |
# uint8_t pscan_period_mode; | |
# uint8_t pscan_mode; | |
# uint8_t dev_class[3]; | |
# uint16_t clock_offset; | |
# } inquiry_info; | |
include Fiddle::Importer | |
bdaddr_t = [ | |
'char b[6]' | |
] | |
Inquiry_info = struct [ | |
*bdaddr_t, # is this right, idk? | |
'char pscan_rep_mode', | |
'char pscan_period_mode', | |
'char pscan_mode', | |
'char dev_class[3]', | |
'unsigned short clock_offset', | |
] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment