Commits

Liam Staskawicz committed 5c969c1

rename only, no logical changes: claimInterface() => openInterface(), releaseInterface() => closeInterface()

  • Participants
  • Parent commits 2353a1c

Comments (0)

Files changed (9)

File example/echo/main.c

     printf("connect: vid 0x%x, pid 0x%x\n", desc.idVendor, desc.idProduct);
 
     if (desc.idVendor == devInfo.vid && desc.idProduct == devInfo.pid) {
-        if (usbusOpen(d) == UsbusOK && usbusClaimInterface(d, 0) == UsbusOK) {
+        if (usbusOpen(d) == UsbusOK && usbusOpenInterface(d, 0) == UsbusOK) {
             *dispose = 0;
             gDevice = d;
         }

File example/enumerator/main.c

         unsigned i;
         for (i = 0; i < cfgDesc.bNumInterfaces; ++i) {
 
-            if (usbusClaimInterface(d, i) != UsbusOK) {
+            if (usbusOpenInterface(d, i) != UsbusOK) {
                 continue;
             }
 
                        e, epDesc.bEndpointAddress, epDesc.bInterval, epDesc.wMaxPacketSize);
             }
 
-            usbusReleaseInterface(d, i);
+            usbusCloseInterface(d, i);
         }
     }
 
 }
 
 
-int usbusClaimInterface(UsbusDevice *d, unsigned index)
+int usbusOpenInterface(UsbusDevice *d, unsigned index)
 {
     if (!d->isOpen) {
         return UsbusNotOpen;
     }
 
-    return gPlatform->claimInterface(d, index);
+    return gPlatform->openInterface(d, index);
 }
 
 
-int usbusReleaseInterface(UsbusDevice *d, unsigned index)
+int usbusCloseInterface(UsbusDevice *d, unsigned index)
 {
     if (!d->isOpen) {
         return UsbusNotOpen;
     }
 
-    return gPlatform->releaseInterface(d, index);
+    return gPlatform->closeInterface(d, index);
 }
 
 

File src/platform/iokit.c

     iokitGetConfigDescriptor,
     iokitGetInterfaceDescriptor,
     iokitGetEndpointDescriptor,
-    iokitClaimInterface,
-    iokitReleaseInterface,
+    iokitOpenInterface,
+    iokitCloseInterface,
     iokitGetConfiguration,
     iokitSetConfiguration,
     iokitSubmitTransfer,
 }
 
 
-int iokitClaimInterface(UsbusDevice *d, unsigned index)
+int iokitOpenInterface(UsbusDevice *d, unsigned index)
 {
     /*
      * Platform specific implementation of usbusClaimInterface().
 }
 
 
-int iokitReleaseInterface(UsbusDevice *d, unsigned index)
+int iokitCloseInterface(UsbusDevice *d, unsigned index)
 {
     struct IOKitInterface *ii = &d->iokit.interfaces[index];
     IOUSBInterfaceInterface_t** intf = ii->intf;
 {
     unsigned i;
     for (i = 0; i < USBUS_MAX_INTERFACES; ++i) {
-        iokitReleaseInterface(d, i);
+        iokitCloseInterface(d, i);
     }
 
     IOUSBDeviceInterface_t** dev = d->iokit.dev;

File src/platform/iokit.h

 int iokitGetInterfaceDescriptor(UsbusDevice *d, unsigned index, unsigned altsetting, struct UsbusInterfaceDescriptor *desc);
 int iokitGetEndpointDescriptor(UsbusDevice *d, unsigned intfIndex, unsigned ep, struct UsbusEndpointDescriptor *desc);
 
-int iokitClaimInterface(UsbusDevice *d, unsigned index);
-int iokitReleaseInterface(UsbusDevice *d, unsigned index);
+int iokitOpenInterface(UsbusDevice *d, unsigned index);
+int iokitCloseInterface(UsbusDevice *d, unsigned index);
 
 int iokitGetConfiguration(UsbusDevice *device, uint8_t *config);
 int iokitSetConfiguration(UsbusDevice *device, uint8_t config);

File src/platform/winusb.c

     winusbGetConfigDescriptor,
     winusbGetInterfaceDescriptor,
     winusbGetEndpointDescriptor,
-    winusbClaimInterface,
-    winusbReleaseInterface,
+    winusbOpenInterface,
+    winusbCloseInterface,
     winusbGetConfiguration,
     winusbSetConfiguration,
     winusbSubmitTransfer,
     return UsbusOK;
 }
 
-int winusbClaimInterface(UsbusDevice *d, unsigned index)
+int winusbOpenInterface(UsbusDevice *d, unsigned index)
 {
     struct WinUSBDevice *wd = &d->winusb;
 
     return UsbusOK;
 }
 
-int winusbReleaseInterface(UsbusDevice *d, unsigned index)
+int winusbCloseInterface(UsbusDevice *d, unsigned index)
 {
     struct WinUSBDevice *wd = &d->winusb;
 

File src/platform/winusb.h

 int winusbGetInterfaceDescriptor(UsbusDevice *d, unsigned index, unsigned altsetting, struct UsbusInterfaceDescriptor *desc);
 int winusbGetEndpointDescriptor(UsbusDevice *d, unsigned intfIndex, unsigned ep, struct UsbusEndpointDescriptor *desc);
 
-int winusbClaimInterface(UsbusDevice *d, unsigned index);
-int winusbReleaseInterface(UsbusDevice *d, unsigned index);
+int winusbOpenInterface(UsbusDevice *d, unsigned index);
+int winusbCloseInterface(UsbusDevice *d, unsigned index);
 
 int winusbGetConfiguration(UsbusDevice *device, uint8_t *config);
 int winusbSetConfiguration(UsbusDevice *device, uint8_t config);
 int usbusGetInterfaceDescriptor(UsbusDevice *d, unsigned index, unsigned altsetting, struct UsbusInterfaceDescriptor *desc);
 int usbusGetEndpointDescriptor(UsbusDevice *d, unsigned intfIndex, unsigned epIndex, struct UsbusEndpointDescriptor *desc);
 
-int usbusClaimInterface(UsbusDevice *d, unsigned index);
-int usbusReleaseInterface(UsbusDevice *d, unsigned index);
+int usbusOpenInterface(UsbusDevice *d, unsigned index);
+int usbusCloseInterface(UsbusDevice *d, unsigned index);
 
 void usbusDispose(UsbusDevice *d);
 

File src/usbus_private.h

     int (*getInterfaceDescriptor)(UsbusDevice *d, unsigned index, unsigned altsetting, struct UsbusInterfaceDescriptor *desc);
     int (*getEndpointDescriptor)(UsbusDevice *d, unsigned intfIndex, unsigned ep, struct UsbusEndpointDescriptor *desc);
 
-    int (*claimInterface)(UsbusDevice *d, unsigned index);
-    int (*releaseInterface)(UsbusDevice *d, unsigned index);
+    int (*openInterface)(UsbusDevice *d, unsigned index);
+    int (*closeInterface)(UsbusDevice *d, unsigned index);
 
     int (*getConfiguration)(UsbusDevice *device, uint8_t *config);
     int (*setConfiguration)(UsbusDevice *device, uint8_t config);