-
Notifications
You must be signed in to change notification settings - Fork 16
Move definitions into new file ttblue.h #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Note to self: PR should be updated if #13 is merged before this one |
Remove structs with files as they are mostly identical between V1 and V2 devices. Use similar format as the ttwatch project do, to simplify a potential future merge of the projects. Some interesting information: * There seem to be 11 bluetooth commands in total used by the android app * There are at least 3 types of notifications: phone call, text message and voice mail/misc.(?)
Add new var read_code and read -c argument into it and then strcpy into dev_code. (Mostly because I couldn't figure out how to read the popt arg into a char[])
poptGetContext returns the int specified in the 5th position in the poptOption struct.
if (read_code != NULL) { | ||
strcpy(dev_code, read_code); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nitpick: please remove the braces, since there's only 1 statement in 'em.
fprintf(stderr, "Pairing code should be 6-digit number.\n"); | ||
goto fatal; | ||
} | ||
fgets(dev_code, 7, stdin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do the string-to-integer confusion here, using strtoul
, rather than in the tt_authorize
function.
If the code isn't a valid decimal integer, we want to catch and report it rather than silently change it to (int)0
(which is the effect of using atoi
without any other validation).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll dust off my v1 and v2 device and have a look at this PR again when I get some time!
/****************************************************************************** | ||
* Messages * | ||
******************************************************************************/ | ||
#define MSG_OPEN_FILE_WRITE (0x02) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0x02 is defined twice in the list, seem to be an error (this line should probably be deleted)
Remove structs with files as they are mostly identical between V1 and V2
devices. Use similar format as the ttwatch project do, as a first step for a potential future merge of the projects.
Some interesting information:
voice mail/misc.(?)