ホーム › Devices.Sensors › ISensor
ISensor
COMメソッド 15
vtbl = vtable インデックス(0始まり)。HSP等からCOMメソッドをインデックス指定で呼ぶ際に使用します。0〜2 は IUnknown。
vtbl 3 HRESULT GetID(GUID* pID)
| pID | GUID* | out | このセンサーの一意な識別子(GUID)を受け取る出力先。 |
vtbl 4 HRESULT GetCategory(GUID* pSensorCategory)
| pSensorCategory | GUID* | out | センサーが属するカテゴリーを示すGUIDを受け取る出力先。位置・環境など。 |
vtbl 5 HRESULT GetType(GUID* pSensorType)
| pSensorType | GUID* | out | センサーの種類を示すGUIDを受け取る出力先。加速度計・GPS等。 |
| pFriendlyName | LPWSTR* | out | ユーザー向けの分かりやすいセンサー名を受け取る出力先。CoTaskMemFreeで解放する。 |
vtbl 7 HRESULT GetProperty(PROPERTYKEY* key, PROPVARIANT* pProperty)
| key | PROPERTYKEY* | in | 取得したいプロパティを識別するPROPERTYKEYへのポインター。 |
| pProperty | PROPVARIANT* | out | 取得したプロパティ値を格納するPROPVARIANTへのポインター。使用後PropVariantClearする。 |
vtbl 8 HRESULT GetProperties(IPortableDeviceKeyCollection* pKeys, IPortableDeviceValues** ppProperties)
| pKeys | IPortableDeviceKeyCollection* | inoptional | 取得対象プロパティキー群を保持するコレクション。NULLを渡すと全プロパティを取得する。 |
| ppProperties | IPortableDeviceValues** | out | 取得結果のキーと値の集合を受け取るIPortableDeviceValuesの出力先。 |
vtbl 9 HRESULT GetSupportedDataFields(IPortableDeviceKeyCollection** ppDataFields)
| ppDataFields | IPortableDeviceKeyCollection** | out | このセンサーがサポートするデータフィールドのキー集合を受け取る出力先。 |
vtbl 10 HRESULT SetProperties(IPortableDeviceValues* pProperties, IPortableDeviceValues** ppResults)
| pProperties | IPortableDeviceValues* | inoptional | 設定するプロパティのキーと値を保持するIPortableDeviceValues。 |
| ppResults | IPortableDeviceValues** | out | 各プロパティ設定の成否(HRESULT)を格納した結果集合を受け取る出力先。 |
vtbl 11 HRESULT SupportsDataField(PROPERTYKEY* key, VARIANT_BOOL* pIsSupported)
| key | PROPERTYKEY* | in | サポート有無を問い合わせるデータフィールドのPROPERTYKEYへのポインター。 |
| pIsSupported | VARIANT_BOOL* | out | サポートされていればVARIANT_TRUE、なければVARIANT_FALSEを受け取る出力先。 |
vtbl 12 HRESULT GetState(SensorState* pState)
| pState | SensorState* | out | センサーの現在の状態(SensorState列挙体。準備完了・アクセス拒否等)を受け取る出力先。 |
vtbl 13 HRESULT GetData(ISensorDataReport** ppDataReport)
| ppDataReport | ISensorDataReport** | out | 最新のセンサーデータを保持するISensorDataReportを受け取る出力先。 |
vtbl 14 HRESULT SupportsEvent(GUID* eventGuid, VARIANT_BOOL* pIsSupported)
| eventGuid | GUID* | in | サポート有無を問い合わせるイベント種別のGUIDへのポインター。 |
| pIsSupported | VARIANT_BOOL* | out | イベントがサポートされていればVARIANT_TRUEを受け取る出力先。 |
| ppValues | GUID** | out | 現在関心登録されているイベントGUIDの配列を受け取る出力先。CoTaskMemFreeで解放する。 |
| pCount | DWORD* | out | 返されるイベントGUIDの個数を受け取る出力先。 |
| pValues | GUID* | inoptional | 関心を登録するイベント種別を表すGUID配列へのポインター。 |
| count | DWORD | in | pValues配列に含まれるGUIDの個数を指定する。 |
vtbl 17 HRESULT SetEventSink(ISensorEvents* pEvents)
| pEvents | ISensorEvents* | inoptional | センサーイベントの通知を受け取るISensorEventsコールバック。NULLでイベント受信を解除する。 |
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"。
出力引数:
#define global IID_ISensor "{5FA08F80-2657-458E-AF75-46F73FA6AC5C}" #usecom global ISensor IID_ISensor "{E97CED00-523A-4133-BF6F-D3A2DAE7F6BA}" #comfunc global ISensor_GetID 3 var #comfunc global ISensor_GetCategory 4 var #comfunc global ISensor_GetType 5 var #comfunc global ISensor_GetFriendlyName 6 var #comfunc global ISensor_GetProperty 7 var,var #comfunc global ISensor_GetProperties 8 sptr,sptr #comfunc global ISensor_GetSupportedDataFields 9 sptr #comfunc global ISensor_SetProperties 10 sptr,sptr #comfunc global ISensor_SupportsDataField 11 var,var #comfunc global ISensor_GetState 12 var #comfunc global ISensor_GetData 13 sptr #comfunc global ISensor_SupportsEvent 14 var,var #comfunc global ISensor_GetEventInterest 15 var,var #comfunc global ISensor_SetEventInterest 16 var,int #comfunc global ISensor_SetEventSink 17 sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※#usecom 末尾は CoCreateInstance 用のクラスID(コクラスCLSID, SDKから自動取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。#define global IID_ISensor "{5FA08F80-2657-458E-AF75-46F73FA6AC5C}" #usecom global ISensor IID_ISensor "{E97CED00-523A-4133-BF6F-D3A2DAE7F6BA}" #comfunc global ISensor_GetID 3 sptr #comfunc global ISensor_GetCategory 4 sptr #comfunc global ISensor_GetType 5 sptr #comfunc global ISensor_GetFriendlyName 6 sptr #comfunc global ISensor_GetProperty 7 sptr,sptr #comfunc global ISensor_GetProperties 8 sptr,sptr #comfunc global ISensor_GetSupportedDataFields 9 sptr #comfunc global ISensor_SetProperties 10 sptr,sptr #comfunc global ISensor_SupportsDataField 11 sptr,sptr #comfunc global ISensor_GetState 12 sptr #comfunc global ISensor_GetData 13 sptr #comfunc global ISensor_SupportsEvent 14 sptr,sptr #comfunc global ISensor_GetEventInterest 15 sptr,sptr #comfunc global ISensor_SetEventInterest 16 sptr,int #comfunc global ISensor_SetEventSink 17 sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※#usecom 末尾は CoCreateInstance 用のクラスID(コクラスCLSID, SDKから自動取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。