title: open cash drawer with TM-T81 epson iOS SDK
body: <p>I want to open a cash drawer which I have bought its printer driven cash drawer. And I have an Epson TM-T81 receipt printer.</p>
  
  <p>I get a delegate called when I open and close the printer manually but I want to open it automatically when receipt is printed.</p>
  
  <p>The code I have written is :</p>
  
  <pre><code>-(void)openDrawer{
      EposBuilder *builder = [[EposBuilder alloc] initWithPrinterModel:@"TM-P20" Lang:0];
      if(builder == nil){
          return ;
      }
  
  //add command
  int result;
  result  = [builder addPulse:EPOS_OC_DRAWER_1 Time:EPOS_OC_PULSE_100];
  NSLog(@"%d command result",result);
  NSString *str = @"27 112 48 55 121";
  NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];
  result = [builder addCommand:data];
  
  NSLog(@"%d pulse",result);
  
  if(result != EPOS_OC_SUCCESS){
      NSLog(@"cut failed");
      return ;
  }
  
  //send builder data
  unsigned long status = 0;
  unsigned long battery = 0;
  result = [printer sendData:builder Timeout:10000 Status:&amp;status Battery:&amp;battery];
  
  //remove builder
  [builder clearCommandBuffer];
  </code></pre>
  
  <p>}</p>
  
  <p>Looking for a solution from experts like you.</p>