/* Create message bus */
s_msgBus = new BusAttachment("myApp", true); /バスを作成します/
if (s_msgBus) {
if (ER_OK == status) {
status = CreateInterface(); /バス上にインタフェースを作成し、結果を返すサブルーティンを呼びます/
}
if (ER_OK == status) {
s_msgBus→RegisterBusListener(s_busListener); /bus上の状況モニターの登録/
}
if (ER_OK == status) {
status = StartMessageBus(); /バスを動作させるサブルーティン/
}
testObj = new BasicSampleObject(*s_msgBus, SERVICE_PATH); /'cat'機能を実現するオブジェクトを生成するサブルーティン/
if (ER_OK == status) {
status = RegisterBusObject(testObj); /バスオブジェクトの登録/
}
if (ER_OK == status) {
status = ConnectBusAttachment(); /メッセージバスを開始するサブルーティンを呼び出す/
}
/*
* Advertise this service on the bus.
* There are three steps to advertising this service on the bus.
* 1) Request a well-known name that will be used by the client to discover
* this service.
* 2) Create a session.
* 3) Advertise the well-known name.
*/
if (ER_OK == status) {
status = RequestName();
}
const TransportMask SERVICE_TRANSPORT_TYPE = TRANSPORT_ANY;
if (ER_OK == status) {
status = CreateSession(SERVICE_TRANSPORT_TYPE); /セッションを開始するサブルーティンを呼び出す/
}
if (ER_OK == status) {
status = AdvertiseName(SERVICE_TRANSPORT_TYPE); /バス上に、サービス名を公開するサブルーティンを呼び出す/
}
/* Perform the service asynchronously until the user signals for an exit. */
if (ER_OK == status) {
WaitForSigInt();
}
} else {
status = ER_OUT_OF_MEMORY;
}
Raspberry PiにAllJoynを移植して、IoTを自作する
「Alljoyn」のいまをクアルコムブースで見る
激化する“IoTの陣取り合戦”欠けているのは「共通言語」
Allseen Allianceの中核技術「Alljoyn」とは何か
IoT団体によるUPnP(Universal Plug and Play)吸収を読み解くCopyright © ITmedia, Inc. All Rights Reserved.
組み込み開発の記事ランキング
コーナーリンク
よく読まれている編集記者コラム