如何查看任何 Arduino 库中可用的库函数?

How to see library functions available in any Arduino library?

当我想编写关于 zigbee 库的代码时,我将如何知道 zigbee 对象支持哪些功能?请帮忙。

假设您想知道 SoftwareSerial.h 提供了什么。在 Arduino 目录中搜索它,例如:C:\Program Files (x86)\Arduino。所有 public 方法任您使用。

这适用于已安装到 Arduino 中的库 IDE:

SoftwareSerial.h:

#include <inttypes.h>
#include <Stream.h>
.........
.........
class SoftwareSerial : public Stream
{
private:
  // per object data
  uint8_t _receivePin;
  uint8_t _receiveBitMask;
  volatile uint8_t *_receivePortRegister;
  uint8_t _transmitBitMask;
  volatile uint8_t *_transmitPortRegister;
.........
.........

public:
  // public methods
  SoftwareSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic = false);
  ~SoftwareSerial();
  void begin(long speed);
  bool listen();
  void end();
  bool isListening() { return this == active_object; }
  bool overflow() { bool ret = _buffer_overflow; _buffer_overflow = false; return ret; }
  int peek();

  virtual size_t write(uint8_t byte);
  virtual int read();
  virtual int available();
  virtual void flush();

  using Print::write;

  // public only for easy access by interrupt handlers
  static inline void handle_interrupt();
};

通常打开一个库头文件,所有 public 方法和属性都供您使用。