Skip to content

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