<commit_before>#define MEWPRO_VERSION_STRING "2016020402"

void printHex(uint8_t d, boolean upper)
{
  char t;
  char a = upper ? 'A' : 'a';
  t = d >> 4 | '0';
  if (t > '9') {
    t += a - '9' - 1;
  }
  Serial.print(t);
  t = d & 0xF | '0';
  if (t > '9') {
    t += a - '9' - 1;
  }
  Serial.print(t);
}

void cameraCommand()
{
  switch ((RECV(1) << 8) + RECV(2)) {
  case GET_CAMERA_INFO:
    memcpy((char *)buf, "\x25\x00\x01\x04\x0cHD3.11.03.03\x14HERO3+ Black Edition", 0x26); // the dongle will act as a HERO3+ Black
    // memcpy((char *)buf, "\x20\x00\x01\x04\x0fHD4.01.02.00.00\x0cHERO4 Silver", 0x21); // not supported yet
    // memcpy((char *)buf, "\x1f\x00\x01\x04\x0fHD4.02.02.00.00\x0bHERO4 Black", 0x20); // not supported yet
    SendBufToBacpac();
    break;
  case GET_CAMERA_WIFI_STATUS:
    if (isMaster) {
      buf[0] = 2; buf[1] = 0; buf[2] = 0; // wifi off
    } else {
      buf[0] = 1; buf[1] = 1; // NAK
    }
    SendBufToBacpac();
    break;
/*********************************************************************
 data structure for {GET|SET}_CAMERA_SETTING is the same as follows: */
    //
    // buf[] RECV() meaning and/or relating bacpac command
    // -----+-----+-----------------------------------------------------
    // 0x00  0x00   packet length (0x27 or 0x28)
    // 0x01         always 0
    //       0x01   always 'T'
    //       0x02   always 'D'
    //              TM SET_BACPAC_DATE_TIME if [3:8] == 0 then no need to set time<commit_msg>send WI0<commit_after>#define MEWPRO_VERSION_STRING "2016020402"

void printHex(uint8_t d, boolean upper)
{
  char t;
  char a = upper ? 'A' : 'a';
  t = d >> 4 | '0';
  if (t > '9') {
    t += a - '9' - 1;
  }
  Serial.print(t);
  t = d & 0xF | '0';
  if (t > '9') {
    t += a - '9' - 1;
  }
  Serial.print(t);
}

void cameraCommand()
{
  switch ((RECV(1) << 8) + RECV(2)) {
  case GET_CAMERA_INFO:
    memcpy((char *)buf, "\x25\x00\x01\x04\x0cHD3.11.03.03\x14HERO3+ Black Edition", 0x26); // the dongle will act as a HERO3+ Black
    // memcpy((char *)buf, "\x20\x00\x01\x04\x0fHD4.01.02.00.00\x0cHERO4 Silver", 0x21); // not supported yet
    // memcpy((char *)buf, "\x1f\x00\x01\x04\x0fHD4.02.02.00.00\x0bHERO4 Black", 0x20); // not supported yet
    SendBufToBacpac();
    break;
  case GET_CAMERA_WIFI_STATUS:
    if (isMaster) {
      buf[0] = 2; buf[1] = 0; buf[2] = 0; // wifi off
    } else {
      buf[0] = 1; buf[1] = 1; // NAK
    }
    SendBufToBacpac();
    queueIn("WI0"); // wifi LED off
    break;
/*********************************************************************
 data structure for {GET|SET}_CAMERA_SETTING is the same as follows: */
    //
    // buf[] RECV() meaning and/or relating bacpac command
    // -----+-----+-----------------------------------------------------
    // 0x00  0x00   packet length (0x27 or 0x28)
    // 0x01         always 0
    //       0x01   always 'T'
    //       0x02   always 'D'
    //              TM SET_BACPAC_DATE_TIME if [3:8] == 0 then no need to set time
{'fraction_non_alphanumeric': 0.24676187313184988, 'fraction_numerical': 0.08502158751245434, 'mean_word_length': 2.045500505561173, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3472512', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1199, 'n_words': 288}