PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
peb_irscan.c
1 #include "simpletools.h"
2 #include "badgetools.h"
3 
4 int irscan(const char *fmt, ...)
5 {
6  char str[128];
7  memset(str, 0, 128);
8  int check = ir_receive(str, 128);
9  //int len = 1 + strlen(str);
10  va_list args;
11  va_start(args, fmt);
12  int blocks = _doscanf_ct(str, fmt, args);
13  //_doscanf_ct(str, fmt, args);
14  va_end(args);
15  if(check) return blocks; else return 0;
16 }
17 
18 /*
19  TERMS OF USE: MIT License
20 
21  Permission is hereby granted, free of charge, to any person obtaining a
22  copy of this software and associated documentation files (the "Software"),
23  to deal in the Software without restriction, including without limitation
24  the rights to use, copy, modify, merge, publish, distribute, sublicense,
25  and/or sell copies of the Software, and to permit persons to whom the
26  Software is furnished to do so, subject to the following conditions:
27 
28  The above copyright notice and this permission notice shall be included in
29  all copies or substantial portions of the Software.
30 
31  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
34  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
36  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
37  DEALINGS IN THE SOFTWARE.
38 */
39 
ir_receive
int ir_receive(char *s, int ssize)
Receive a string with a specified maxiumum number of characters over IR.
Definition: peb_ir_receive.c:31
irscan
int irscan(const char *fmt,...)
Use to receive strings over IR from another badge in a manner similar to retrieving strings that repr...
Definition: peb_irscan.c:4
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
badgetools.h
This library provides convenient functions for a variety of Parallax eBadge operations.