SDK

IXPAND

Introduction

The SanDisk® iXpand is a family of storage accessories for devices running Apple’s iOS. iXpand devices enable transfer and storage of photos, music, videos and files between iPhones, iPads, PCs and Mac computers. iXpand accessories are accessible over Lightning® and USB connectors.

The SanDisk iXpand SDK enables third party application developers to access and manage iXpand devices from their own iOS applications through the Lightning interface.

The SDK includes the binaries, libraries, simulator, demo and information for creating your app, using native Swift iOS code and examples. These are intended to show basic developer use of the iXpand device through the API in a iOS development environment.

The development process is to integrate the iXpand SDK into your app, perform your validation process, and submit your app to Western Digital to obtain the Product Plan ID (PPID) code that will be asked for when you submit your app to Apple.

The following figure shows the high level architecture for applications developed on the iXpand SDK:

 

 

Figure 1 - Conceptual Block Diagram

SDK HOME

You will need a free WD Developer Portal account to download the binaries and libraries for the iXpand SDK - click here to sign up. After you have a WD Developer Portal account, click here to download the iXpand SDK.

 

SDK REQUIREMENTS

  • Mac® OS X® 10.8.5 or higher
  • 2 GB RAM or More
  • 8 GB or more hard disk space
  • Xcode 10.2 or above

 

LICENSES

iXpand SDK contains the FATFS open source taken from http://elm-chan.org/fsw/ff/00index_e.html. For further information on use and licensing, refer to http://elm-chan.org/fsw/ff/en/appnote.html#license.

 

Concepts

The iXpand SDK contains two sets of APIs:

  • File System APIs
  • System APIs

File system APIs provide familiar filesystem API to the iXpand device for managing storage related software operations. System APIs provide access to administration functionality not directly related to storage.

The iXpand SDK is available as an iOS framework file. A developer needs to include the framework and header files within the the target application’s source tree for successful integration.

 

Modules Overview

To access the iXpand SDK, developers must first initialize “iXpandSystemController" and "FileSystemController" respectively. All system APIs are accessible as part of "iXpandSystemController" and file system APIs are accessible over “FileSystemController”.

To initialize the iXpand, "iXpandSystemController" instance is created first followed by calling "initDrive" and "OpenSession". When "OpenSession" is completed, iXpand is ready to communicate. Instances of "FileSystemController" can be created to deal with File System APIs. When all operations with iXpand device are completed, the application can close communication with the device using "closeSession" API.

COMPILATION INSTRUCTIONS

Include the “iXpandSDK.framework” along with other libraries that your application requires.

 

Figure 3 - Adding Library

In the application code, include the following headers to allow access to the APIs:

        #import <iXpandSDK/iXpandFileSystemAPI.h>

        #import <iXpandSDK/iXpandSystemAPI.h>

FILE WRITE EXAMPLE

The code snippet below shows how to initialize the iXpand drive:

if (![[iXpandSystemController sharedController] initDrive:accessory]) {           
            dispatch_sync(dispatch_get_main_queue(), ^{
                [self.consoleString appendString:@"Drive Initialisation failed"];
                [self updateConsole];
                    return;
            });
     } else {
    If( [[iXpandSystemController sharedController] openSession]) {
         // iXpand is successfully opened
   }
}

The following code snippet shows an example of opening a file and writing to iXpand:

If([[iXpandFileSystemController sharedController]
changeDirectoryAbsolutePath:@"\\"]){
            Int handle = [[iXpandFileSystemController sharedController]
            openFileAbsolutePath:path openMode:mode];
            if (handle != -1)
           {
                       uint32_t dataLength = 0;
                       uint32_t uintDataSize = 0;
                       uint32_t uintDataTranLen = 0;
                       uintDataSize = (uint32_t)[self returnFileSize:test0];
                       @synchronized(self){
                        while((dataLength != -1) && (uintDataSize != 0))
                             {
                                   @autoreleasepool {
                                         uintDataTranLen =
            ((uintDataSize > MAX_DATABUFFER) ? MAX_DATABUFFER : uintDataSize);
                              [[fileHandle readDataOfLength:uintDataTranLen] getBytes:byDataBuf];
                             NSData *aData = [NSData dataWithBytes:byDataBuf length:sizeof(byDataBuf)];
                             dataLength = [[iXpandFileSystemController sharedController] writeFile:handle writeBuf:aData writeSize:uintDataTranLen];
                             uintDataSize -= dataLength;
                        }
                       }
                  [[iXpandFileSystemController sharedController] closeFile:handle];
                       [fileHandle closeFile];
           }
    }
}

The following code snippet shows closing a session with iXpand after a file operation is done:

[[iXpandSystemController sharedController] closeSession];

DESIGN GUIDELINES

iXpand does not generate thumbnails and metadata information of media files. The developer will need to create or use a third party application or library to render thumbnail and metadata if required.

NOTE: The iXpand accessory does not protect application specific files.

The application developer has the flexibility to organize iXpand files in any manner as intended.

We recommend you call iXpand File System APIs from a non-UI thread to offer a better user experience.

 

Downloads

You will need a free WD Developer Portal account to download the binaries and libraries for the iXpand SDK - click here to sign up. After you have a WD Developer Portal account, click here to download the iXpand SDK. You will download a file named similar to 'Ixpand-sdk-21.zip', extract it to a project directory.

 

IXPAND SDK APPS

The SDK includes a simulator and a debug and release app. You should run the simulator for testing your app on your PC, and use the Debug and Release versions for deployment to the actual iOS device.

 

SIMULATOR

1. Load Project in Xcode

Download the sample application and load in Xcode as depicted below

 

Figure 1 - Load Project in Xcode

2. Go to Edit Scheme

 

Figure 2 - Edit Scheme

3. Build Configuration

Change Build Configuration to TEST

 

Figure 3 - Test Build Configuration

4. Change Device

Change the device to an iOS Simulator

 

Figure 4 - Change to iOS Simulator

5. Run Simulator

Run the sample app and try it out, your iPhone simulator should look like the below with the iXpand simulator running in a separate window.

 

Figure 5 - Simulator Running

First you can tap on Open Session, and then you can tap on the other buttons to see the communication from the iPhone simulator to the iXpand simulator appearing at the bottom of your screen.

 

SIMULATOR VIEWS

Here is a sample of the views that the simulator shows:

 

Figure 1 - Open Session

 

Figure 3 - Get Software Version

 

Figure 4 - Read / Create File

 

Figure 5 - Read Folder

 

APP DEBUG BUILD

1. Load Debug into Xcode

Download the example application and load into Xcode.

 

Figure 1 - Start Here

2. Go to Edit Scheme

 

Figure 2 - Edit Scheme

3. Build Configuration

Change Build Configuration to debug.

 

Figure 3 - Debug Build Configuration

4. Change Device

Change Device to a real device.

 

Figure 4 - Change Device

5. Select Ixpand Demo Folder

Select the 'iXpandSDK_Demo' folder in the folder navigation.

 

Figure 5 - Navigate to iXpandSDK_Demo

6. Manage Signing

Enable 'Automatically manage signing' and allow it to reset the build settings.

 

Figure 6 - Manage Signing

7. Select a 'Provisioning Profile'

 

Figure 7 - Provision Profile

8. Go to Build Settings

 

Figure 8 - Build Settings

9. Change Code Signing

In 'Signing' change 'Code Signing Identity' to 'iOS Developer'.

 

Figure 9 - Sign as iOS Developer

10. Change Bundle Identifier

Go to 'General' and in 'identity' change 'Bundle Identifier' to a new one.

 

Figure 10 - Change Bundle Identifier

11. Build Demo

Click 'Try Again' in signing and start building the Debug Demo.

 

Figure 11 - Build Debug Demo

 

APP RELEASE BUILD

1. Add app framework to Xcode

Download the sample application and open the project in Xcode.

 

Figure 1 - Open Project in Xcode

2. Edit Scheme

Go to Edit Scheme.

 

Figure 2 - Edit Scheme

3. Set Build Configuration

Change Build Configuration to debug.

 

Figure 3 - Set Build Configuration

4. Change Device

Change device to a real device.

 

Figure 4 - Change Device

5. Select App Framework

Select iXpandSDK_Demo in the folder navigation.

 

Figure 5 - Select App Framework

6. Set Signing

Enable 'Automatically manage signing'.

 

Figure 6 - Set Signing

7. Provisioning Profile

Select a 'Provisioning Profile'.

 

Figure 7 - Provisioning Profile

8. Build settings

Go to Build Settings.

 

Figure 8 - Build Settings

9. Code Signing

In 'Signing' change 'Code Signing Identity' to 'iOS Developer'.

 

Figure 9 - Code Signing

10. Change Bundle Identifier

Go to 'General' and in 'identity' change 'Bundle Identifier' to a new one.

 

Figure 10 - Change Bundle Identifier

11. Build App

Click 'Try Again' in signing and start building the Demo.

 

Figure 11 - Build App

REQUEST HARDWARE

We may be able to assist in obtaining hardware to use during your development activities. Make your request hardware here.

 

SUBMIT APP

Submit your app for us to qualify & publish in the App Catalog.

 

APP SHOWCASE

Check out apps built using the iXpand SDK

 

GET SUPPORT

Send us a message if you need help or have questions.

 

 

 

 

 

 

 

Do more with the
iXpand SDK

Click the buttons below to visit the iXpand Developer Home & Workflow pages

 

Developer
Home

Get started, access the SDK, build your apps, & learn more


View Home

Developer
Workflow

Register & submit your app for review and contact support


View Workflow