Search Smart Card Decoding Program. Exact capabilities will depend on what you're using for the hardware-accelerated decoding (e On OSX it works with the built-in Wi-Fi interfaces, and on Windows 10 it will work with remote captures Inside the Box: Decoder, Smart Card, Remote controller, Smart LNB, HDMI Cable and power pack Description With an Explora, you can record up to 220 hours of your
Iam a beginner programmer and have problem about sending CCID Command to the Smart Card via Usb Host on Android mobile device. This time I sent PC_to_RDR_IccPowerOn CCID command PC_to_RDR_IccPowerOn to activate the card and received ATR response back.
Search Smart Card Decoding Program. When you are done, use the BasicCard compiler to convert your application to P-Code and load it to the E²Prom of your BasicCard On OSX it works with the built-in Wi-Fi interfaces, and on Windows 10 it will work with remote captures Type 1: IC/ID Reader/Writer Duplicator Relaying a local smart card (`--type=relay 🙂 Maklumat akaun terdapat di dalam smart
Dịch Vụ Hỗ Trợ Vay Tiền Nhanh 1s. Hello! USB Audio devices that work flawless on every other Win10 machine, fail to work on my Lenovo ThinkPad X1 Carbon Gen 9 with Smart Sound Technology for USB Audio driver version All Win10 updates are installed, BIOS is up to date. Please find the system support utility output attached. Failure descriptionSpeechMike Premium Touch SMP3700 has a distorted playback see Speak 710 fails to playback at all with the OS error message "Failed to play test tone". No 3rd party software is involved for the playback test, simply hit the "Test" button on the advanced tab of the speaker properties see attached screenshot. Lenovo Support suggests to switch to High Definition Audio Controller driver which indeed solves the USB audio issue, but renders the internal mic/speaker of the notebook useless. Therefore this is no solution. It must be possible that USB audio devices and the internal audio devices both work with one set of drivers, like with any other notebook out there. Any help is highly appreciated. BR, Michael
A Universal Media Player can combine multiple existing entities in Home Assistant into a single media player entity. This is used to create a single media player entity that can control an entire media center. Multiple media player entities may be controlled from a Universal Media Player. Additionally, the Universal Media Player can enable volume and power commands to be directed to other Home Assistant entities. This enables the media player power and volume commands to control devices like a television, amplifier or audio receiver, for example. A Universal Media Player is created in as follows. Example entry media_player - platform universal name MEDIA_PLAYER_NAME children - - commands turn_on service SERVICE data SERVICE_DATA turn_off service SERVICE data SERVICE_DATA volume_up service SERVICE data SERVICE_DATA volume_down service SERVICE data SERVICE_DATA volume_mute service SERVICE data SERVICE_DATA media_play service SERVICE data SERVICE_DATA media_pause service SERVICE data SERVICE_DATA media_previous_track service SERVICE data SERVICE_DATA media_next_track service SERVICE data SERVICE_DATA attributes is_volume_muted ENTITY_IDATTRIBUTE state ENTITY_IDATTRIBUTE browse_media_entity device_class tv unique_id a_unique_string Configuration Variables name string Required The name to assign to the player. children list Optional Ordered list of child media players that this entity will control. state_template template Optional A template can be specified to render the state of the media player. In this way, the state may depend on entities that are not themselves media players, like switches or input booleans. commands string Optional Media player commands to be overridden. Almost all media player service commands may be overridden. Example entries are turn_on, turn_off, select_source, volume_set, volume_up, volume_down, volume_mute, media_play, media_pause, media_stop, media_previous_track, media_next_track and play_media refer to the media_player documentation to see the full list. attributes string Optional Attributes that can be overridden. Most, if not all, media player attributes can be overridden. Example entries are is_volume_muted, state, source, source_list and volume_level. The values should be an entity ID and state attribute separated by a pipe character . If the entity ID’s state should be used, then only the entity id needs to be provided. browse_media_entity string Optional Allows override the browse media entity to desired media player. device_class string Optional The device class that this entity represents. Can be tv, speaker, or receiver. unique_id string Optional A unique identifier for this entity. Needs to be unique within the media_player platform. The Universal Media Player will primarily imitate one of its children. The Universal Media Player will control the first child on the list that is active not idle/off. The Universal Media Player will also inherit its state from the first active child if a state_template is not provided. Entities in the children list must be media players, but the state template can contain any entity. It is recommended that the command turn_on, the command turn_off, and the attribute state all be provided together. The state attribute indicates if the media player is on or off. If state indicates the media player is off, this status will take precedence over the states of the children. If all the children are idle/off and state is on, the Universal Media Player’s state will be on. If not provided, the toggle command will delegate to turn_on or turn_off based on the state. It is also recommended that the command volume_up, the command volume_down, the command volume_mute, and the attribute is_volume_muted all be provided together. The attribute is_volume_muted should return either True or the on state when the volume is muted. The volume_mute service should toggle the mute setting. When providing select_source as a command, it is recommended to also provide the attributes source, and source_list. The source attribute is the currently select source, while the source_list attribute is a list of all available sources. When using state_template, if you use a template that depends on the current time it is recommended to use now. Using now will cause templates to be refreshed at the start of every new minute. For more information see the time section in the template documentation. The browse_media_entity parameter allows you to specify which media player will be used in media browser. Usage examples Chromecast & Kodi control with switches In this example, a switch is available to control the power to the television. Switches are also available to turn the volume up, turn the volume down, and mute the audio. These could be command line switches or any other entity in Home Assistant. The turn_on and turn_off commands will be redirected to the television, and the volume commands will be redirected to an audio receiver. The select_source command will be passed directly to an A/V receiver. The children are a Chromecast and a Kodi player. If the Chromecast is playing, the Universal Media Player will reflect its status. If the Chromecast is idle and Kodi is playing, the universal media player will change to reflect its status. media_player platform universal name Test Universal children - - commands turn_on service target entity_id turn_off service target entity_id volume_up service target entity_id volume_down service target entity_id volume_mute service target entity_id select_source service target entity_id data source "{{ source }}" volume_set service target entity_id data volume_level "{{ volume_level }}" attributes state is_volume_muted volume_level source source_list Kodi CEC-TV control In this example, a Kodi Media Player runs in a CEC capable device OSMC/OpenElec running in a Raspberry Pi 24/7, for example, and, with the JSON-CEC Kodi add-on installed, it can turn on and off the attached TV. We store the state of the attached TV in an input boolean, so we can differentiate the TV being on or off, while Kodi is always idle’, and use the universal media player to render its state with a template. We now can differentiate between the idle’ and the off’ state being the second when it is idle and the TV is off. Because the input boolean used to store the TV state is only changing when using the Home Assistant turn_on and turn_off actions, and Kodi could be controlled by so many ways, we also define some automations to update this Input Boolean when needed. The complete configuration is homeassistant customize friendly_name Kodi input_boolean kodi_tv_state media_player - platform universal name Kodi TV state_template > {% if is_state' 'idle' and is_state' 'off' %} off {% else %} {{ states' }} {% endif %} children - commands turn_on service target entity_id turn_off service target entity_id attributes is_volume_muted volume_level - platform kodi name Kodi host turn_on_action - service target entity_id - service target entity_id data method addonid params command activate turn_off_action - service target entity_id - service target entity_id - service target entity_id data method addonid params command standby automation - alias "Turn on the TV when Kodi is activated" trigger platform state entity_id from "off" to "playing" action - service target entity_id - alias "Turn off the TV when Kodi is in idle > 15 min" trigger platform state entity_id to "idle" for minutes 15 action - service target entity_id Harmony Remote Example The complete configuration is media_player - platform universal name Media Room TV attributes state source_list source commands turn_on service target entity_id turn_off service target entity_id volume_up service target entity_id data device Receiver command VolumeUp volume_down service target entity_id data device Receiver command VolumeDown select_source service target entity_id data activity "{{ source }}" device_class tv unique_id media_room_harmony_hub Help us to improve our documentation Suggest an edit to this page, or provide/view feedback for this page.
Introduction This is the third article on using the PC/SC Smart Card API in Windows with PC/SC card readers. The code in these articles will be in C++11 using the Unicode character set and has been tested with Microsoft Visual Studio 2015 Community. It also assumed that the reader has a grasp of C++11 and Windows development. During the course of these articles we shall be developing a simple class for handling the smart card API. Unfortunately we cannot publish details specific to MIFARE DESFire technology, as these are protected under NXP™’s non-disclosure agreement with partners. Background The article shows how to use the PC/SC Windows API to detect when a card has been presented to the card reader and will then read the unique identifier UID from a the card. This code has been tested with the following Readers HID Omnikey 5021CL, ACS ACR122 & Identive CLOUD 3700 F Cards MIFARE Standard 1K, MIFARE Ultralight, MIFARE DESFire EV1 Detecting cards The steps required in detecting the presence of a contactless card require the following steps. Get context handle SCardEstablishContext Get the status of the reader that is being monitored SCardGetStatusChange Compare the dwCurrentState and dwEventState members in SCARD_READERSTATE to determine if there has been a status change. Perform the required operation on the card, read the UID in our case. Reading the status change for smartcards is a little different to other windows operations in that it is not event driven, so the smartcard sub-system needs to be polled. It should be noted that the SCardStatusChange function blocks it does not return until either a status change has occurred or the timeout has expired. To prevent the application from locking up one of the following techniques could be used Use a very short timeout – suitable if application has a polling loop. Trigger a poll via WM_TIMER OnTimer in MFC application again with a very short timeout. Use a separate thread. To read a status change, the SCardGetStatusChange function is called which has the following parameters LONG WINAPI SCardGetStatusChange _In_ SCARDCONTEXT hContext, _In_ DWORD dwTimeout, _Inout_ LPSCARD_READERSTATE rgReaderStates, _In_ DWORD cReaders ; The rgReaderStates parameter is an array of SCARD_READERSTATE structures. This structure has the following syntax typedef struct { LPCTSTR szReader; LPVOID pvUserData; DWORD dwCurrentState; DWORD dwEventState; DWORD cbAtr; BYTE rgbAtr[36]; } SCARD_READERSTATE, *PSCARD_READERSTATE, *LPSCARD_READERSTATE; The member variables are used as follows see the MSDN documentation for further details. Variable Use szReader The name of the reader to monitor, typically this name will typically have been obtained via a SCardListReaders function call. pvUserData Not used. dwCurrentState A bitfield of the last recorded state of the reader, is set by the application. dwEventState A bitfield of the current state of the reader as known by the smart card subsystem. cbAtr The number of bytes in rgbAtr. rgbAtr The ATR of the inserted card. The SCardGetStatusChange function works by comparing the dwCurrentState with the actual state of the reader. If there is a mismatch then the dwEventState is updated with the actual reader state. The SCARD_STATE_CHANGED flag will also be set to indicate that there is difference between the 2 state members. So that an accurate reader state can be initially retrieved the dwCurrentState should be set to SCARD_STATE_UNAWARE and dwEventState set to 0x00. The following code shows how this can easily be achieved. SCARD_READERSTATE readerState = {}; = _T"Identiv CLOUD 3700 F Contactless Reader 0"; = SCARD_STATE_UNAWARE; The basic code to detect that a reader has changed its status would look like this long ret = SCardGetStatusChangehSC, 1, &readerState, 1; if ret == SCARD_SUCCESS { if & SCARD_STATE_CHANGED { // the reader state has changed.... OnStateChangereaderState; // clear the SCARD_STATE_CHANGED flag = & ~SCARD_STATE_CHANGED; } } After the call to SCardGetStatusChange, dwEventState is copied to dwCurrentState but with the SCARD_STATE_CHANGED bit cleared. This is then ready to be used for the next call to SCardGetStatusChange in order to detect the next state change. The other flags for dwCurrentState and dwEventState are Value dwCurrentState Meaning dwEventState meaning SCARD_STATE_UNAWARE State is unknown dwEventState will be set to the current state of the reader on the next call to SCardGetStatusChange not used SCARD_STATE_IGNORE Not interested in this reader not used SCARD_STATE_CHANGED not used There is a difference between the expected state and the actual state SCARD_STATE_UNKNOWN not used The reader is not recognized SCARD_STATE_UNAVALABLE Reader not expected to be available for use The state for this reader is not available SCARD_STATE_EMPTY No card in reader is expected No Card in reader SCARD_STATE_PRESENT Card in reader is expected There is a card in the reader SCARD_STATE_ATRMATCH ATR of card in reader expected to match one of the target cards There is a card in the reader with an ATR that matches one of the target cards. SCARD_STATE_EXCLUSIVE Card in reader is expected to be in exclusive use by another program Card in reader is used exclusively by another program SCARD_STATE_INUSE Card in the reader is expected to be in use Card in reader is in use SCARD_STATE_MUTE Unresponsive card in the reader is expected There is an unresponsive card in the reader In order to detect the presence of a card on the reader, the SCARD_STATUS_PRESENT flag needs to be checked. To test that the card has just been presented then this flag will be clear in dwCurrentState but set in dwEventState. The following code illustrates how that is achieved bool foundCard = false; long ret = SCardGetStatusChangem_hSC, timeout, &readerState, 1; if ret == SCARD_S_SUCCESS { if & SCARD_STATE_CHANGED { if & SCARD_STATE_PRESENT == 0 && & SCARD_STATE_PRESENT { // have a card.... } = & ~SCARD_STATE_CHANGED; } } This technique can also be used to detect any of the other state conditions as well as detecting if a card has been removed. To extend the CSmartcard class from our previous article How to read a MIFARE UID using PC/SC so it can detect cards we add a new member variable to the header, like this protected stdvector m_readerState; and then initialise the vector in the ListReaders function // get a list of readers const CReaderList& CSmartcardListReaders { // initialise if not already done Init; // will auto allocate memory for the list of readers TCHAR *pszReaderList = nullptr; DWORD len = SCARD_AUTOALLOCATE; LONG ret = SCardListReaders m_hSC, NULL, // groups, using null will list all readers in the system LPWSTR&pszReaderList, // pointer where to store the readers &len; // will return the length of characters in the reader list buffer if ret == SCARD_S_SUCCESS { TCHAR *pszReader = pszReaderList; while *pszReader { pszReader += _tcslenpszReader + 1; } // free the memory ret = SCardFreeMemorym_hSC, pszReaderList; // and set up the reader state list for const auto &reader m_readers { SCARD_READERSTATE readerState = {}; = reader; = SCARD_STATE_UNAWARE; } } else { throw CSmartcardExceptionret; } return m_readers; } A new function can be added that will detect if a card has been inserted in the case of a contact card or placed on a reader if contactless. It would look like this // waits for a card to be presented to a reader bool CSmartcardWaitForCardCString & readerName, DWORD timeout { bool foundCard = false; long ret = SCardGetStatusChangem_hSC, timeout, if ret == SCARD_S_SUCCESS { // which reader had a card for auto pos = pos != && !found; ++pos { if pos->dwEventState & SCARD_STATE_CHANGED { if pos->dwCurrentState & SCARD_STATE_PRESENT == 0 && pos->dwEventState & SCARD_STATE_PRESENT { readerName = pos->szReader; foundCard = true; } pos->dwCurrentState = pos->dwEventState & ~SCARD_STATE_CHANGED; } } } return foundCard; } To use these updates to the CSmartcard class from an application the following method could be used. CSmartcard smartcard; try { // initialise the smart-card class // get a list of attached readers bool finished = false; while !finished { // test for key press to exit loop if _kbhit { finished = true; } // and wait for 1ms for a card to be presented CString readerName; if 1 { // connect to this reader _tprintf_T"Card on reader %s - UID %I64X\n", readerName, } } } catch const CSmartcardException &ex { _tprintf_T"Error %s, 0x%08x\n", } Note that the while loop will exit if any key is pressed on the keyboard. If a card is detected then it will be read and the UID is read. Card on reader Identiv CLOUD 3700 F Contactless Reader 0 - UID 42E18F2893180 Card on reader Identiv CLOUD 3700 F Contactless Reader 0 - UID FE8C8C97 Card on reader Identiv CLOUD 3700 F Contactless Reader 0 - UID 4B90DEA704880 Now what? Once the state of a card reader has been detected, it can be read or written to, in this article we have just read the card’s UID but it would, equally, be possible to read or write to the card if it was a memory card. Reading sector data from a MIFARE card will be covered in a further article to follow. Source code include " include " int _tmainint argc, _TCHAR* argv[] { CSmartcard smartcard; try { // initialise the smart-card class // get a list of attached readers bool finished = false; while !finished { // test for key press to exit loop if _kbhit { finished = true; } // and wait for 1ms for a card to be presented CString readerName; if 1 { // connect to this reader _tprintf_T"Card on reader %s - UID %I64X\n", readerName, } } } catch const CSmartcardException &ex { _tprintf_T"Error %s, 0x%08x\n", } return 0; } // defines wrapper class for PC/SC smartcard API pragma once include include include include // also need to link in pragma commentlib, " using CReaderList = stdvector; // defines wrapper class for PC/SC smart card API class CSmartcard { public CSmartcard; ~CSmartcard; // initialise interface, throws CSmartcardException void Init; // get a list of readers throws CSmartcardException const CReaderList& ListReaders; // connect to card on specified reader, throws CSmartcardException void Connectconst CString &reader; // gets the UID from the current card // returns as unsigned 64 bit int // throws CSmardcardException or CAPDUException uint64_t GetUID; // wait for card bool WaitForCardCString &readerName, DWORD timeout; protected SCARDCONTEXT m_hSC; SCARDHANDLE m_hCard; DWORD m_activeProtocol; CReaderList m_readers; stdvector m_readerState; }; // the definition of the exception class class CSmartcardException { public CSmartcardExceptionLONG errorCode m_errorCodeerrorCode { } // get error code inline LONG ErrorCode const { return m_errorCode; } // get text for error code inline CString ErrorText const { return CString_com_errorm_errorCode.ErrorMessage; } protected LONG m_errorCode; }; // exception class for APDU errors class CAPDUException { public CAPDUExceptionconst UCHAR *error CAPDUExceptionerror[0], error[1] { } CAPDUExceptionUCHAR e1, UCHAR e2 { m_errorCode = static_caste1 e2; } // get the error code inline USHORT GetErrorCode const { return m_errorCode; } inline CString GetErrorCodeText const { CString str; m_errorCode; return str; } protected USHORT m_errorCode; }; include " include " // the constructor CSmartcardCSmartcard m_hSCNULL, m_hCardNULL { } // and the destructor CSmartcard~CSmartcard { if m_hCard { SCardDisconnectm_hSC, m_hCard; } if m_hSC { SCardReleaseContextm_hSC; } } // initialise interface void CSmartcardInit { if m_hSC == NULL { LONG ret = SCardEstablishContextSCARD_SCOPE_USER, NULL, NULL, &m_hSC; if ret != SCARD_S_SUCCESS { throw CSmartcardExceptionret; } } } // get a list of readers const CReaderList& CSmartcardListReaders { // initialise if not already done Init; // will auto allocate memory for the list of readers TCHAR *pszReaderList = nullptr; DWORD len = SCARD_AUTOALLOCATE; LONG ret = SCardListReaders m_hSC, NULL, // groups, using null will list all readers in the system LPWSTR&pszReaderList, // pointer where to store the readers &len; // will return the length of characters in the reader list buffer if ret == SCARD_S_SUCCESS { TCHAR *pszReader = pszReaderList; while *pszReader { pszReader += _tcslenpszReader + 1; } // free the memory ret = SCardFreeMemorym_hSC, pszReaderList; // and set up the reader state list for const auto &reader m_readers { SCARD_READERSTATE readerState = {0}; = reader; = SCARD_STATE_UNAWARE; } } else { throw CSmartcardExceptionret; } return m_readers; } // connect to card on specified reader, throws CSmartcardException void CSmartcardConnectconst CString &reader { DWORD protocolsSCARD_PROTOCOL_T0 SCARD_PROTOCOL_T1; m_activeProtocol = 0; LONG ret = SCardConnectm_hSC, reader, SCARD_SHARE_SHARED, protocols, &m_hCard, &m_activeProtocol; if ret != SCARD_S_SUCCESS { throw CSmartcardExceptionret; } } // gets the UID from the current card, throws CSmardcardException // returns as unsigned 64 bit unsigned int uint64_t CSmartcardGetUID { uint64_t uid0; // check that have a card handle if m_hCard == NULL { throw CSmartcardExceptionSCARD_E_INVALID_HANDLE; } // create the get data APDU UCHAR sendBuffer[] = { 0xff, // CLA - the instruction class 0xCA, // INS - the instruction code 0x00, // P1 - 1st parameter to the instruction 0x00, // P2 - 2nd parameter to the instruction 0x00 // Le - size of the transfer }; UCHAR receiveBuffer[32]; DWORD sendLength; DWORD receiveLength_countofreceiveBuffer; // set up the io request SCARD_IO_REQUEST ioRequest; = m_activeProtocol; = sizeofioRequest; LONG ret = SCardTransmitm_hCard, &ioRequest, sendBuffer, _countofsendBuffer, // the send buffer & length NULL, receiveBuffer, &receiveLength; // the receive buffer and length if ret == SCARD_S_SUCCESS { // have received a response. Check that did not get an error if receiveLength >= 2 { // do we have an error if receiveBuffer[receiveLength - 2] != 0x90 receiveBuffer[receiveLength - 1] != 0x00 { throw CAPDUException &receiveBuffer[receiveLength - 2]; } else if receiveLength > 2 { for DWORD i = 0; i != receiveLength - 2; i++ { uid receiveBuffer[i]; } } } else { // didn't get a recognisable response, // so throw a generic read error throw CSmartcardExceptionERROR_READ_FAULT; } } else { throw CSmartcardExceptionret; } return uid; } // waits for a card to be presented to a reader bool CSmartcardWaitForCardCString & readerName, DWORD timeout { bool foundCard = false; long ret = SCardGetStatusChangem_hSC, timeout, if ret == SCARD_S_SUCCESS { // which reader had a card for auto pos = pos != ++pos { _tprintf_T" - reader %s - state 0x%x\n", pos->szReader, pos->dwEventState; if pos->dwEventState & SCARD_STATE_CHANGED { if pos->dwCurrentState & SCARD_STATE_PRESENT == 0 && pos->dwEventState & SCARD_STATE_PRESENT { readerName = pos->szReader; foundCard = true; } pos->dwCurrentState = pos->dwEventState & ~SCARD_STATE_CHANGED; } } } return foundCard; } pragma once include " include include include define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit include include
smart card mute first media