I need help with libusb, if anyone is familiar with it

Hi guys, I want to perform a simple task using libusb. I have written code that will attempt to open a usb device which is my Cell Phone in this case and then this code will create a folder in the file structure of me cell phone and then create a text document within that folder and in the text document there must be a string that reads "Hello from your PC". My problem is in the part where the program must create a folder and a text tile in the cell phone. Other than that, the code is able to open the cell. please see the code below. thanking you in advance.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <fstream>
#include <libusb-1.0/libusb.h>
#include <string>

using namespace std;

int main(int argc, char** argv){
	// discover devices
	ofstream ofile;
	libusb_device_handle* handler = NULL;
	libusb_device* dev = NULL;
	struct libusb_device_descriptor devDesc;
	struct libusb_interface* interface;
	struct libusb_endpoint_descriptor* endPtrDesc;
	uint8_t devicePath;
	unsigned char data[32];
		
	int interfaceNum = 0;
	int transferSize;
	unsigned char dirStr[256];
		
	int retVal = 0;   
	
	retVal = libusb_init(NULL);
	
	handler = libusb_open_device_with_vid_pid(NULL, 0x04e8, 0x6860);
	retVal = libusb_claim_interface(handler, interfaceNum); 
	dev = libusb_get_device(handler);
	
	devicePath = libusb_get_port_number(dev);
	//devicePath = libusb_get_device_address(dev);
	retVal = libusb_get_string_descriptor_ascii(handler, devicePath, dirStr, 256);
	
	string filePath(dirStr, dirStr+sizeof(dirStr));
	
	
	cout << dirStr <<endl;
	
	ofile.open("GT-I9100/Phone/New_File_From_PC/testFile.txt");
	ofile << "Test Text";
	
	if(handler == NULL){
	  cout << "No device was found" <<endl;
	}
	else
	  cout << "Device found" << endl;
		
	//while(true){
	  libusb_bulk_transfer(handler, 0x01, data, 32, &transferSize, 2000);
	//}	
		
	libusb_exit(NULL);

	return 0;
}
Topic archived. No new replies allowed.