Skip to content

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Grimler91
Copy link
Contributor

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:

  • 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.(?)

@Grimler91
Copy link
Contributor Author

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);
}

Copy link
Owner

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);
Copy link
Owner

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).

Copy link
Contributor Author

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)
Copy link
Contributor Author

@Grimler91 Grimler91 Dec 2, 2020

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants