当前位置: 首页>>代码示例>>C++>>正文


C++ par_get函数代码示例

本文整理汇总了C++中par_get函数的典型用法代码示例。如果您正苦于以下问题:C++ par_get函数的具体用法?C++ par_get怎么用?C++ par_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了par_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: net_sms_handle_gprsq

BOOL net_sms_handle_gprsq(char *caller, char *command, char *arguments)
{
    char *s;

    if (sys_features[FEATURE_CARBITS]&FEATURE_CB_SOUT_SMS) return FALSE;

    net_send_sms_start(caller);

    s = stp_rom(net_scratchpad, "GPRS:");
    s = stp_s(s, "\r\n APN:", par_get(PARAM_GPRSAPN));
    s = stp_s(s, "\r\n User:", par_get(PARAM_GPRSUSER));
    s = stp_s(s, "\r\n Password:", par_get(PARAM_GPRSPASS));
    s = stp_s(s, "\r\n GSM:", car_gsmcops);

    if (!inputs_gsmgprs())
        s = stp_rom(s, "\r\n GPRS: DISABLED");
    else if (net_msg_serverok)
        s = stp_rom(s, "\r\n GPRS: OK\r\n Server: Connected OK");
    else if (net_state == NET_STATE_READY)
        s = stp_rom(s, "\r\n GSM: OK\r\n Server: Not connected");
    else
    {
        s = stp_x(s, "\r\n GSM/GPRS: Not connected (0x", net_state);
        s = stp_rom(s, ")");
    }

    net_puts_ram(net_scratchpad);

    return TRUE;
}
开发者ID:jasonwiener,项目名称:Open-Vehicle-Monitoring-System,代码行数:30,代码来源:net_sms.c

示例2: net_msg_register

// Register to the NET OVMS server
void net_msg_register(void)
  {
  char k;
  char *p;
  unsigned int sr;

  // Make a (semi-)random client token
  sr = TMR0L*256;
  sr += TMR0H;
  for (k=0;k<8;k++)
    {
    sr += can_databuffer[k];
    }
  srand(sr);
  for (k=0;k<TOKEN_SIZE;k++)
    {
    token[k] = cb64[rand()%64];
    }
  token[TOKEN_SIZE] = 0;

  p = par_get(PARAM_SERVERPASS);
  hmac_md5(token, TOKEN_SIZE, p, strlen(p), digest);

  net_puts_rom("MP-C 0 ");
  net_puts_ram(token);
  net_puts_rom(" ");
  base64encodesend(digest, MD5_SIZE);
  net_puts_rom(" ");
  p = par_get(PARAM_VEHICLEID);
  net_puts_ram(p);
  net_puts_rom("\r\n");
  }
开发者ID:tomsax,项目名称:Open-Vehicle-Monitoring-System,代码行数:33,代码来源:net_msg.c

示例3: net_send_sms_start

void net_send_sms_start(char* number)
  {
  if (net_state == NET_STATE_DIAGMODE)
    {
    // DIAG mode: screen output
    net_puts_rom("# ");
    }
  else if (net_msg_bufpos)
    {
    // NET SMS wrapper mode: nothing to do here
    // net_put* will write to net_msg_bufpos
    }
  else
    {
    // MODEM mode:
    net_puts_rom("AT+CMGS=\"");
    net_puts_ram(number);
    net_puts_rom("\"\r\n");
    delay100(2);
    }

  if ((car_time > 315360000)&&
      ((sys_features[FEATURE_CARBITS]&FEATURE_CB_SSMSTIME)==0))
    {
    // Car time is valid, and sms time is not disabled
    char *p = par_get(PARAM_TIMEZONE);
    char *s = stp_time(net_scratchpad, NULL, car_time + timestring_to_mins(p)*60L);
    s = stp_rom(s, "\r ");
    net_puts_ram(net_scratchpad);
    }
  }
开发者ID:duderdice,项目名称:Open-Vehicle-Monitoring-System,代码行数:31,代码来源:net_sms.c

示例4: net_sms_handle_paramsq

BOOL net_sms_handle_paramsq(char *caller, char *command, char *arguments)
{
    unsigned char k, splen, msglen;
    char *p, *s;

    if (sys_features[FEATURE_CARBITS]&FEATURE_CB_SOUT_SMS) return FALSE;

    net_send_sms_start(caller);
    net_puts_rom("Params:");
    msglen=7;
    for (k=0; k<PARAM_MAX; k++)
    {
        p = par_get(k);
        if (*p != 0)
        {
            s = stp_i(net_scratchpad, "\n", k);
            s = stp_s(s, ":", p);
            splen = s - net_scratchpad;
            if((msglen+splen) > 160)
            {
                // SMS becomes too long, finish & start next:
                net_send_sms_finish();
                delay100(20);
                net_send_sms_start(caller);
                net_puts_rom("Params:");
                msglen=7+splen;
            }
            net_puts_ram(net_scratchpad);
        }
    }
    return TRUE;
}
开发者ID:jasonwiener,项目名称:Open-Vehicle-Monitoring-System,代码行数:32,代码来源:net_sms.c

示例5: net_sms_handle_gsmlockq

BOOL net_sms_handle_gsmlockq(char *caller, char *command, char *arguments)
{
    char *p;

    if (sys_features[FEATURE_CARBITS]&FEATURE_CB_SOUT_SMS) return FALSE;

    net_send_sms_start(caller);
    net_puts_rom("GSMLOCK: ");

    p = par_get(PARAM_GSMLOCK);
    if (*p == 0)
    {
        net_puts_rom("(none)\r\n");
    }
    else
    {
        net_puts_ram(p);
        net_puts_rom("\r\n");
    }

    stp_s(net_scratchpad, "Current: ", car_gsmcops);
    net_puts_ram(net_scratchpad);

    return TRUE;
}
开发者ID:jasonwiener,项目名称:Open-Vehicle-Monitoring-System,代码行数:25,代码来源:net_sms.c

示例6: net_sms_handle_serverq

BOOL net_sms_handle_serverq(char *caller, char *command, char *arguments)
{
    char *s;

    if (sys_features[FEATURE_CARBITS]&FEATURE_CB_SOUT_SMS) return FALSE;

    net_send_sms_start(caller);

    s = stp_rom(net_scratchpad, "Server:");
    s = stp_s(s, "\r\n IP:", par_get(PARAM_SERVERIP));
    s = stp_s(s, "\r\n Password:", par_get(PARAM_SERVERPASS));
    s = stp_s(s, "\r\n Paranoid:", par_get(PARAM_PARANOID));

    net_puts_ram(net_scratchpad);

    return TRUE;
}
开发者ID:jasonwiener,项目名称:Open-Vehicle-Monitoring-System,代码行数:17,代码来源:net_sms.c

示例7: can_initialise

////////////////////////////////////////////////////////////////////////
// can_initialise()
// This function is an entry point from the main() program loop, and
// gives the CAN framework an opportunity to initialise itself.
//
void can_initialise(void)
  {
  char *p;

  car_type[0] = 'V'; // Car is type VA - Volt/Ampera
  car_type[1] = 'A';
  car_type[2] = 0;

  CANCON = 0b10010000; // Initialize CAN
  while (!CANSTATbits.OPMODE2); // Wait for Configuration mode

  // We are now in Configuration Mode
  RXB0CON = 0b00000000; // RX buffer0 uses Mask RXM0 and filters RXF0, RXF1

  RXM0SIDL = 0b10100000;
  RXM0SIDH = 0b11111111;	// Set Mask0 to 0x7fd

  RXF0SIDL = 0b00000000;	// Setup Filter0 and Mask so that only CAN ID 0x100 and 0x102 will be accepted
  RXF0SIDH = 0b00100000;	// Set Filter0 to 0x100

  RXB1CON = 0b00000000;	// RX buffer1 uses Mask RXM1 and filters RXF2, RXF3, RXF4, RXF5

  RXM1SIDL = 0b11100000;
  RXM1SIDH = 0b11111111;	// Set Mask1 to 0x7ff

  RXF2SIDL = 0b10000000;	// Setup Filter2 so that CAN ID 0x344 will be accepted
  RXF2SIDH = 0b01101000;

  RXF3SIDL = 0b01000000;	// Setup Filter3 so that CAN ID 0x402 will be accepted
  RXF3SIDH = 0b10000000;

  RXF4SIDL = 0b00000000;        // Setup Filter4 so that CAN ID 0x400 will be accepted
  RXF4SIDH = 0b10000000;

  BRGCON1 = 0; // SET BAUDRATE to 1 Mbps
  BRGCON2 = 0xD2;
  BRGCON3 = 0x02;

  CIOCON = 0b00100000; // CANTX pin will drive VDD when recessive
  if (sys_features[FEATURE_CANWRITE]>0)
    {
    CANCON = 0b00000000;  // Normal mode
    }
  else
    {
    CANCON = 0b01100000; // Listen only mode, Receive bufer 0
    }

  RCONbits.IPEN = 1; // Enable Interrupt Priority
  PIE3bits.RXB1IE = 1; // CAN Receive Buffer 1 Interrupt Enable bit
  PIE3bits.RXB0IE = 1; // CAN Receive Buffer 0 Interrupt Enable bit
  IPR3 = 0b00000011; // high priority interrupts for Buffers 0 and 1

  p = par_get(PARAM_MILESKM);
  can_mileskm = *p;
  can_lastspeedmsg[0] = 0;
  can_lastspeedrpt = 0;
  }
开发者ID:davidemele,项目名称:Open-Vehicle-Monitoring-System,代码行数:63,代码来源:can_voltampera.c

示例8: net_sms_handle_moduleq

BOOL net_sms_handle_moduleq(char *caller, char *command, char *arguments)
{
    char *s;

    if (sys_features[FEATURE_CARBITS]&FEATURE_CB_SOUT_SMS) return FALSE;

    net_send_sms_start(caller);

    s = stp_rom(net_scratchpad, "Module:");
    s = stp_s(s, "\r\n VehicleID:", par_get(PARAM_VEHICLEID));
    s = stp_s(s, "\r\n Units:", par_get(PARAM_MILESKM));
    s = stp_s(s, "\r\n Notifications:", par_get(PARAM_NOTIFIES));
    s = stp_s(s, "\r\n VehicleType:", par_get(PARAM_VEHICLETYPE));

    net_puts_ram(net_scratchpad);

    return TRUE;
}
开发者ID:jasonwiener,项目名称:Open-Vehicle-Monitoring-System,代码行数:18,代码来源:net_sms.c

示例9: net_sms_handle_passq

BOOL net_sms_handle_passq(char *caller, char *command, char *arguments)
{
    char *p = par_get(PARAM_MODULEPASS);

    if (sys_features[FEATURE_CARBITS]&FEATURE_CB_SOUT_SMS) return FALSE;

    net_send_sms_start(caller);
    stp_s(net_scratchpad, "Module password: ", p);
    net_puts_ram(net_scratchpad);
    return TRUE;
}
开发者ID:jasonwiener,项目名称:Open-Vehicle-Monitoring-System,代码行数:11,代码来源:net_sms.c

示例10: net_sms_handle_registerq

BOOL net_sms_handle_registerq(char *caller, char *command, char *arguments)
{
    char *p = par_get(PARAM_REGPHONE);

    if (sys_features[FEATURE_CARBITS]&FEATURE_CB_SOUT_SMS) return FALSE;

    net_send_sms_start(caller);
    stp_s(net_scratchpad, "Registered number: ", p);
    net_puts_ram(net_scratchpad);
    return TRUE;
}
开发者ID:jasonwiener,项目名称:Open-Vehicle-Monitoring-System,代码行数:11,代码来源:net_sms.c

示例11: net_sms_stat

void net_sms_stat(char* number)
  {
  char *p;

#ifdef OVMS_SUPPRESS_OUTGOING_SMS
  return;
#endif

  delay100(2);
  net_send_sms_start(number);

  switch (car_chargemode)
    {
    case 0x00:
      net_puts_rom("Standard - "); // Charge Mode Standard
      break;
    case 0x01:
      net_puts_rom("Storage - "); // Storage
      break;
    case 0x03:
      net_puts_rom("Range - "); // Range
      break;
    case 0x04:
      net_puts_rom("Performance - "); // Performance
    }
  switch (car_chargestate)
    {
    case 0x01:
      net_puts_rom("Charging"); // Charge State Charging
      break;
    case 0x02:
      net_puts_rom("Charging, Topping off"); // Topping off
      break;
    case 0x04:
      net_puts_rom("Charging Done"); // Done
      break;
    default:
      net_puts_rom("Charging Stopped"); // Stopped
    }

  net_puts_rom(" \rIdeal Range: "); // Ideal Range
  p = par_get(PARAM_MILESKM);
  if (*p == 'M') // Kmh or Miles
    sprintf(net_scratchpad, (rom far char*)"%u mi", car_idealrange); // Miles
  else
    sprintf(net_scratchpad, (rom far char*)"%u Km", (unsigned int) (((float) car_idealrange * 1.609))+0.5); // Kmh
  net_puts_ram(net_scratchpad);

  net_puts_rom(" \rSOC: ");
  sprintf(net_scratchpad, (rom far char*)"%u%%", car_SOC); // 95%
  net_puts_ram(net_scratchpad);
  net_puts_rom("\x1a");
  }
开发者ID:git109,项目名称:Open-Vehicle-Monitoring-System,代码行数:53,代码来源:net_sms.c

示例12: net_sms_checkcaller

// We start with two helper functions
unsigned char net_sms_checkcaller(char *caller)
{
    char *p = par_get(PARAM_REGPHONE);
    if (*p && strncmp(p,caller,strlen(p)) == 0)
        return 1;
    else
    {
        if ((sys_features[FEATURE_CARBITS]&FEATURE_CB_SAD_SMS) == 0)
            net_send_sms_rom(caller,NET_MSG_DENIED);
        return 0;
    }
}
开发者ID:jasonwiener,项目名称:Open-Vehicle-Monitoring-System,代码行数:13,代码来源:net_sms.c

示例13: net_sms_checkpassarg

unsigned char net_sms_checkpassarg(char *caller, char *arguments)
{
    char *p = par_get(PARAM_MODULEPASS);

    if ((arguments != NULL)&&(*p && strncmp(p,arguments,strlen(p))==0))
        return 1;
    else
    {
        if ((sys_features[FEATURE_CARBITS]&FEATURE_CB_SAD_SMS) == 0)
            net_send_sms_rom(caller,NET_MSG_DENIED);
        return 0;
    }
}
开发者ID:jasonwiener,项目名称:Open-Vehicle-Monitoring-System,代码行数:13,代码来源:net_sms.c

示例14: net_msg_alert

void net_msg_alert(void)
  {
  char *p;

  delay100(2);
  net_msg_start();
  strcpypgm2ram(net_scratchpad,(char const rom far*)"MP-0 PA");

  switch (car_chargemode)
    {
    case 0x00:
      strcatpgm2ram(net_scratchpad,(char const rom far *)"Standard - "); // Charge Mode Standard
      break;
    case 0x01:
      strcatpgm2ram(net_scratchpad,(char const rom far *)"Storage - "); // Storage
      break;
    case 0x03:
      strcatpgm2ram(net_scratchpad,(char const rom far *)"Range - "); // Range
      break;
    case 0x04:
      strcatpgm2ram(net_scratchpad,(char const rom far *)"Performance - "); // Performance
    }
  switch (car_chargestate)
    {
    case 0x01:
      strcatpgm2ram(net_scratchpad,(char const rom far *)"Charging"); // Charge State Charging
      break;
    case 0x02:
      strcatpgm2ram(net_scratchpad,(char const rom far *)"Charging, Topping off"); // Topping off
      break;
    case 0x04:
      strcatpgm2ram(net_scratchpad,(char const rom far *)"Charging Done"); // Done
      break;
    default:
      strcatpgm2ram(net_scratchpad,(char const rom far *)"Charging Stopped"); // Stopped
    }

  strcatpgm2ram(net_scratchpad,(char const rom far *)"\rIdeal Range: "); // Ideal Range
  p = par_get(PARAM_MILESKM);
  if (*p == 'M') // Kmh or Miles
    sprintf(net_msg_scratchpad, (rom far char*)"%u mi", car_idealrange); // Miles
  else
    sprintf(net_msg_scratchpad, (rom far char*)"%u Km", (unsigned int) ((float) car_idealrange * 1.609)); // Kmh
  strcat((char*)net_scratchpad,net_msg_scratchpad);

  strcatpgm2ram(net_scratchpad,(char const rom far *)" SOC: ");
  sprintf(net_msg_scratchpad, (rom far char*)"%u%%", car_SOC); // 95%
  strcat(net_scratchpad,net_msg_scratchpad);
  net_msg_encode_puts();
  net_msg_send();
  }
开发者ID:Roadster,项目名称:Open-Vehicle-Monitoring-System,代码行数:51,代码来源:net_msg.c

示例15: net_notify_status

////////////////////////////////////////////////////////////////////////
// net_notify_status()
// Emits a status notification error to the user (by SMS)
// upon request (e.g. by an incoming call or sms STAT command).
//
void net_notify_status(void)
  {
  // Emit an unsolicited notification showing current status
  char *p,*q;
  p = par_get(PARAM_NOTIFIES);
  if (strstrrampgm(p,(char const rom far*)"SMS") != NULL)
    {
    net_sms_notify = 1;
    }
  if (strstrrampgm(p,(char const rom far*)"IP") != NULL)
    {
    net_msg_notify = 1;
    }
  }
开发者ID:Roadster,项目名称:Open-Vehicle-Monitoring-System,代码行数:19,代码来源:net.c


注:本文中的par_get函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。