MWX Library
v0.1.9
v0.1.9
  • The MWX Library
  • 改版履歴
  • MWXライブラリについて
    • License
    • 用語
    • 設計情報
  • インストール・ビルド
    • 環境 (OSなど)
    • TWELITE SDK のインストール
    • VS Codeのインストール
    • アクトのビルド
    • アクトの実行
      • tweterm.py
    • 新しいプロジェクトの作成
    • ビルド定義 Makefile
    • 他のプラットフォーム
  • サンプルアクト
    • act0 .. 4
    • Scratch
    • Slp_Wk_and_Tx
    • Parent_MONOSTICK
    • PingPong
    • BRD_APPTWELITE
    • BRD_ARIA
    • PAL_AMB
    • PAL_AMB-usenap
    • PAL_AMB-bhv
    • PAL_MAG
    • PAL_MOT-single
    • PAL_MOT-fifo
    • PulseCounter
    • WirelessUART
    • Unit_???
  • API
    • 定義
    • クラスオブジェクト
      • the_twelite
      • Analogue
      • Buttons
      • EEPROM
      • PulseCounter
      • Serial
      • SerialParser
      • SPI
        • SPI (メンバ関数版)
        • SPI (ヘルパークラス版)
      • TickTimer
      • Timer0 .. 4
      • Wire
        • Wire (メンバ関数版)
        • Wire (ヘルパークラス版)
    • クラス
      • MWX_APIRET
      • alloc
      • axis_xyzt
      • packet_rx
      • packet_tx
      • serparser
      • pktparser
        • E_PKT
        • idenify_packet_type()
        • TwePacket
          • TwePacketTwelite
          • TwePacketIO
          • TwePacketUART
          • TwePacketPAL
      • smplbuf
        • .get_stream_helper()
        • smplbuf_strm_u8
      • smplque
      • mwx::stream
        • format (mwx::mwx_format)
        • mwx::bigendian
        • mwx::crlf
        • mwx::flush
        • stream_helper
      • SM_SIMPLE ステートマシン
    • コールバック関数
      • setup()
      • begin()
      • loop()
      • wakeup()
      • init_coldboot()
      • init_warmboot()
    • ビヘイビア
      • PAL_AMB-behavior
    • 関数
      • システム関数
        • millis()
        • delay()
        • delayMicroseconds()
        • random()
      • DIO 汎用ディジタルIO
        • pinMode()
        • digitalWrite()
        • digitalRead()
        • attachIntDio()
        • detachIntDio()
        • digitalReadBitmap()
      • ユーティリティ関数
        • Printf utils
        • pack_bits()
        • collect_bits()
        • Byte array utils
        • pack_bytes()
        • expand_bytes()
        • CRC8, XOR, LRC
        • div100()
        • Scale utils
  • ボード (BRD)
    • <BRD_APPTWELITE>
    • <MONOSTICK>
    • PAL
      • <PAL_AMB>
      • <PAL_MAG>
      • <PAL_MOT>
      • <PAL_NOTICE>
    • <CUE>
    • <ARIA>
  • センサー・デバイス (SNS)
    • SHTC3 - 温湿度センサー
    • SHT3x - 温湿度センサー
    • LTR-308ALS - 照度センサー
    • MC3630 - 加速度センサー
    • BMx280 - 環境センサー
    • PCA9632 - LEDドライバ
    • SHT4x - 温湿度センサー
  • ネットワーク (NWK)
    • シンプル中継ネット <NWK_SIMPLE>
  • 設定 (STG) - インタラクティブモード
    • <STG_STD>
GitBook提供
このページ内
PDFとしてエクスポート
  1. API
  2. クラス
  3. smplbuf

smplbuf_strm_u8

前へ.get_stream_helper()次へsmplque

最終更新 3 年前

uint8_t型のsmplbuf_strm_u8???はインタフェースも有しているため、いくつかのストリーム用のメソッドを使用することができます。

// smplbuf_strm_u8<N> : ローカル確保
template <int N> using smplbuf_strm_u8 
  = _smplbuf_stream<uint8_t, mwx::alloc_local<uint8_t, N>>;

// smplbuf_strm_u8_attach : 既存バッファへのアタッチ版
using smplbuf_strm_u8_attach 
  = mwx::_smplbuf_stream<uint8_t, mwx::alloc_attach<uint8_t>>;

// smplbuf_strm_u8_heap : HEAP確保
using smplbuf_strm_u8_heap 
  = mwx::_smplbuf_stream<uint8_t, mwx::alloc_heap<uint8_t>>;

// << 演算子の定義
template <class L_STRM, class ALOC>
mwx::stream<L_STRM>& operator << (
        mwx::stream<L_STRM>& lhs, 
        mwx::_smplbuf_stream<uint8_t, ALOC>& rhs)
{
		lhs << rhs.to_stream();
		return lhs;
}

例

smplbuf_strm_u8<128> sb1;

sb1 << "hello";
sb1 << uint32_t(0x30313233);
sb1 << format("world%d",99);
sb1.printfmt("Z!");

Serial << sb1;
// hello0123world99Z!

ストリーム(stream)