This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void ble_stack_init(void) | |
{ | |
// Initialize SoftDevice. | |
SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, false); | |
// Subscribe for BLE events. | |
uint32_t err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch); | |
APP_ERROR_CHECK(err_code); | |
// Register with the SoftDevice handler module for BLE events. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableData* data = [NSMutableData dataWithLength:sizeof(uint8_t) * 100]; | |
uint8_t* array = [data mutableBytes]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import "SKPSMTPMessage.h" | |
#import "NSData+Base64Additions.h" | |
@interface ViewController : UIViewController<SKPSMTPMessageDelegate> | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error | |
{ | |
uint8_t *byte = (uint8_t *)[characteristic.value bytes]; | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error | |
{ | |
NSString* str = [[NSString alloc] initWithData:characteristic.value encoding:NSUTF8StringEncoding]; | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <MailCore/MailCore.h> | |
... | |
-(void) sendEmail:(NSString *) message | |
{ | |
MCOSMTPSession *smtpSession = [[MCOSMTPSession alloc] init]; | |
smtpSession.hostname = @"smtp.gmail.com"; // SMTPサーバのアドレス | |
smtpSession.port = 465; | |
smtpSession.username = @"moemoe"; // SMTPサーバのユーザ名 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<usb-device vendor-id="1118" product-id="688"></usb-device> | |
<usb-device vendor-id="1027" product-id="24577" /> <!-- FT232RL --> | |
<usb-device vendor-id="1027" product-id="24596" /> <!-- FT232H --> | |
<usb-device vendor-id="1027" product-id="24592" /> <!-- FT2232C/D/HL --> | |
<usb-device vendor-id="1027" product-id="24593" /> <!-- FT4232HL --> | |
<usb-device vendor-id="1027" product-id="24597" /> <!-- FT230X --> | |
<usb-device vendor-id="1412" product-id="45088" /> <!-- REX-USB60F --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"gccArmPath": "/usr/local/gcc-arm-none-eabi-6-2017-q2-update", | |
"nrf5SdkPath": "~/Documents/Nordic/nRF5_SDK_15.2.0_9412b96" | |
}, | |
"configurations": [{ | |
"name": "Mac", | |
"includePath": [ | |
"${gccArmPath}/arm-none-eabi/include", | |
"${gccArmPath}/arm-none-eabi/include/bits", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var state = 0; | |
function hoge(a) { | |
if(state === 0) { | |
setTimeout(function(){console.log(a);},1000); | |
} else { | |
setTimeout(function(){console.log(a);},500); | |
} | |
state++; | |
} |
OlderNewer