repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "cec: fix timeout"
[deb_libcec.git]
/
include
/
CECExportsCpp.h
diff --git
a/include/CECExportsCpp.h
b/include/CECExportsCpp.h
index fd4ea9fa078c8f99501c93930ffa7d3230c73826..34905735ea63a3931fde9925cc20bccf564b2f2c 100644
(file)
--- a/
include/CECExportsCpp.h
+++ b/
include/CECExportsCpp.h
@@
-33,53
+33,46
@@
namespace CEC
{
namespace CEC
{
- class ICEC
Device
+ class ICEC
Adapter
{
public:
{
public:
+ /*! @name Adapter methods */
+ //@{
/*!
* @see cec_open
*/
/*!
* @see cec_open
*/
- virtual bool Open(const char *strPort,
in
t iTimeoutMs = 10000) = 0;
+ virtual bool Open(const char *strPort,
uint32_
t iTimeoutMs = 10000) = 0;
/*!
/*!
- * @see cec_
find_devices
+ * @see cec_
close
*/
*/
- virtual
int FindDevices(std::vector<cec_device> &deviceList, const char *strDevicePath = NULL
) = 0;
+ virtual
void Close(void
) = 0;
/*!
/*!
- * @see cec_
ping
+ * @see cec_
find_adapters
*/
*/
- virtual
bool Ping(void
) = 0;
+ virtual
int8_t FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL
) = 0;
/*!
/*!
- * @see cec_start_bootloader
- */
- virtual bool StartBootloader(void) = 0;
-
- /*!
- * @see cec_power_off_devices
- */
- virtual bool PowerOffDevices(cec_logical_address address = CECDEVICE_BROADCAST) = 0;
-
- /*!
- * @see cec_power_on_devices
+ * @see cec_ping_adapters
*/
*/
- virtual bool P
owerOnDevices(cec_logical_address address = CECDEVICE_BROADCAST
) = 0;
+ virtual bool P
ingAdapter(void
) = 0;
/*!
/*!
- * @see cec_sta
ndby_devices
+ * @see cec_sta
rt_bootloader
*/
*/
- virtual bool StandbyDevices(cec_logical_address address = CECDEVICE_BROADCAST) = 0;
+ virtual bool StartBootloader(void) = 0;
+ //@}
/*!
/*!
- * @see cec_
set_active_view
+ * @see cec_
get_min_version
*/
*/
- virtual
bool SetActiveView
(void) = 0;
+ virtual
int8_t GetMinVersion
(void) = 0;
/*!
/*!
- * @see cec_
set_inactive_view
+ * @see cec_
get_lib_version
*/
*/
- virtual
bool SetInactiveView
(void) = 0;
+ virtual
int8_t GetLibVersion
(void) = 0;
/*!
* @see cec_get_next_log_message
/*!
* @see cec_get_next_log_message
@@
-99,7
+92,7
@@
namespace CEC
/*!
* @see cec_transmit
*/
/*!
* @see cec_transmit
*/
- virtual bool Transmit(const cec_frame &data, bool bWaitForAck = true
, int64_t iTimeout = (int64_t) 5000
) = 0;
+ virtual bool Transmit(const cec_frame &data, bool bWaitForAck = true) = 0;
/*!
* @see cec_set_logical_address
/*!
* @see cec_set_logical_address
@@
-107,23
+100,31
@@
namespace CEC
virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress) = 0;
/*!
virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress) = 0;
/*!
- * @
deprecated use SetLogicalAddress() instead
+ * @
see cec_power_on_devices
*/
*/
- virtual bool
SetAckMask(uint16_t iMask
) = 0;
+ virtual bool
PowerOnDevices(cec_logical_address address = CECDEVICE_TV
) = 0;
/*!
/*!
- * @see cec_
get_min_version
+ * @see cec_
standby_devices
*/
*/
- virtual
int GetMinVersion(void
) = 0;
+ virtual
bool StandbyDevices(cec_logical_address address = CECDEVICE_BROADCAST
) = 0;
/*!
/*!
- * @see cec_
get_lib_version
+ * @see cec_
set_active_view
*/
*/
- virtual int GetLibVersion(void) = 0;
+ virtual bool SetActiveView(void) = 0;
+
+ /*!
+ * @see cec_set_inactive_view
+ */
+ virtual bool SetInactiveView(void) = 0;
+
};
};
};
};
-extern DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, int iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS);
+extern DECLSPEC void * CECCreate(const char *strDeviceName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS);
+
+extern DECLSPEC void CECDestroy(CEC::ICECAdapter *instance);
#if !defined(DLL_EXPORT)
#if defined(_WIN32) || defined(_WIN64)
#if !defined(DLL_EXPORT)
#if defined(_WIN32) || defined(_WIN64)
@@
-136,9
+137,9
@@
static int g_iLibCECInstanceCount = 0;
/*!
* @see cec_init
*/
/*!
* @see cec_init
*/
-inline CEC::ICEC
Device *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, in
t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS)
+inline CEC::ICEC
Adapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_
t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS)
{
{
- typedef void* (__cdecl*_CreateLibCec)(const char *, uint8_t, uint
8
_t);
+ typedef void* (__cdecl*_CreateLibCec)(const char *, uint8_t, uint
16
_t);
_CreateLibCec CreateLibCec;
if (!g_libCEC)
_CreateLibCec CreateLibCec;
if (!g_libCEC)
@@
-150,16
+151,20
@@
inline CEC::ICECDevice *LoadLibCec(const char *strName, CEC::cec_logical_address
CreateLibCec = (_CreateLibCec) (GetProcAddress(g_libCEC, "CECCreate"));
if (!CreateLibCec)
return NULL;
CreateLibCec = (_CreateLibCec) (GetProcAddress(g_libCEC, "CECCreate"));
if (!CreateLibCec)
return NULL;
- return static_cast< CEC::ICEC
Device* > (CreateLibCec(strName,
iLogicalAddress, iPhysicalAddress));
+ return static_cast< CEC::ICEC
Adapter* > (CreateLibCec(strName, (uint8_t)
iLogicalAddress, iPhysicalAddress));
}
/*!
* @brief Unload the given libcec instance.
* @param device The instance to unload.
*/
}
/*!
* @brief Unload the given libcec instance.
* @param device The instance to unload.
*/
-inline void UnloadLibCec(CEC::ICEC
Device
*device)
+inline void UnloadLibCec(CEC::ICEC
Adapter
*device)
{
{
- delete device;
+ typedef void (__cdecl*_DestroyLibCec)(void * device);
+ _DestroyLibCec DestroyLibCec;
+ DestroyLibCec = (_DestroyLibCec) (GetProcAddress(g_libCEC, "CECDestroy"));
+ if (DestroyLibCec)
+ DestroyLibCec(device);
if (--g_iLibCECInstanceCount == 0)
{
if (--g_iLibCECInstanceCount == 0)
{
@@
-173,18
+178,19
@@
inline void UnloadLibCec(CEC::ICECDevice *device)
/*!
* @see cec_init
*/
/*!
* @see cec_init
*/
-inline CEC::ICEC
Device *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, in
t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS)
+inline CEC::ICEC
Adapter *LoadLibCec(const char *strName, CEC::cec_logical_address iLogicalAddress = CEC::CECDEVICE_PLAYBACKDEVICE1, uint16_
t iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS)
{
{
- return (CEC::ICEC
Device
*) CECCreate(strName, iLogicalAddress, iPhysicalAddress);
+ return (CEC::ICEC
Adapter
*) CECCreate(strName, iLogicalAddress, iPhysicalAddress);
};
/*!
* @brief Unload the given libcec instance.
* @param device The instance to unload.
*/
};
/*!
* @brief Unload the given libcec instance.
* @param device The instance to unload.
*/
-inline void UnloadLibCec(CEC::ICEC
Device
*device)
+inline void UnloadLibCec(CEC::ICEC
Adapter
*device)
{
{
- delete device;
+ device->Close();
+ CECDestroy(device);
};
#endif
};
#endif