Blame view

RIOT/tests/emb6/common.h 1.49 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
  /*
   * Copyright (C) 2016 Martine Lenders <mlenders@inf.fu-berlin.de>
   *
   * This file is subject to the terms and conditions of the GNU Lesser
   * General Public License v2.1. See the file LICENSE in the top level
   * directory for more details.
   */
  
  /**
   * @ingroup     tests
   * @{
   *
   * @file
   * @brief   Definitions for tests/emb6/
   *
   * @author  Martine Lenders <mlenders@inf.fu-berlin.de>
   */
  #ifndef COMMON_H
  #define COMMON_H
  
  #include <stdint.h>
  #include <sys/types.h>
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @brief   Application configuration
   * @{
   */
  #define SOCK_INBUF_SIZE         (256)
  #define SERVER_MSG_QUEUE_SIZE   (8)
  #define SERVER_BUFFER_SIZE      (64)
  /**
   * @}
   */
  
  /**
   * @brief   Converts hex string to byte array.
   *
   * @param[out] out  Resulting byte array
   * @param[in] in    `\0` terminated string. Non-hex characters (all except 0-9, a-f, A-F)
   *                  will be ignored.
   *
   * @return  Length of @p out.
   */
  size_t hex2ints(uint8_t *out, const char *in);
  
  /**
   * @brief   Ping shell command
   *
   * @param[in] argc  number of arguments
   * @param[in] argv  array of arguments
   *
   * @return  0 on success
   * @return  other on error
   */
  int ping_cmd(int argc, char **argv);
  
  #ifdef MODULE_EMB6_SOCK_UDP
  /**
   * @brief   UDP IP shell command
   *
   * @param[in] argc  number of arguments
   * @param[in] argv  array of arguments
   *
   * @return  0 on success
   * @return  other on error
   */
  int udp_cmd(int argc, char **argv);
  #endif
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* COMMON_H */
  /** @} */