Contact Us

Tel: 86-512-62861666

Fax: 86-512-62861666

Mob:+86 13218196967

E-mail:sales_02@simya.com.cn

Type C Adapter Higher Frequency Oct 20, 2017

Now the notebook all only has the USB interface, uses in the mouth, the computer exists is the USB interface, how to communicate? You can use USB to connect the computer and embedded devices, including USB one end connected to the computer, serial and external devices to communicate. However, on some embedded devices (such as ARM9), communication is usually made using serial ports and computers. Embedded devices are connected to the embedded device. The computer and the embedded device because the interface is not compatible, can not communicate, and using USB to the serial port of this Type C Adapter, the two will be able to normal data communication. In design mode, there is a similar pattern in which there are two different classes of interfaces that can use an Type C Adapter class to convert an interface to another interface that the customer wants, called Type C Adapter mode.

In Type C Adapter mode, a wrapper class called an Type C Adapter (Type C Adapter) is introduced, and the object it wraps is called a wildcard (adaptee), which is the appropriate class. The realization of Type C Adapter is to transform the request of customer class into the corresponding interface of the Type C Adapter. That is, when the client class calls the Type C Adapter's method, the method of the Type C Adapter class is called inside the Adaptor class, which is transparent to the customer class, and the customer class does not directly access the wildcard class. Therefore, Type C Adapters can work with classes that cannot interact because of incompatible interfaces.

Type C Adapter mode can match the interface of a class with the interface of another class without modifying the original Type C Adapter interface and abstract target class interface. The Type C Adapter mode is defined as follows:

In Type C Adapter mode, we solve the problem of incompatible interfaces by adding a new Type C Adapter class so that classes that do not have any relationships can work together. Depending on the Type C Adapter class, the Type C Adapter pattern can be divided into object Type C Adapters and class Type C Adapters, and in object Type C Adapter mode, the Type C Adapter is associated with the adaptor; In class Type C Adapter mode, an inheritance (or implementation) relationship is between the Type C Adapter and the adaptor. In actual development, object Type C Adapters are used more frequently.