Skip to content

Instantly share code, notes, and snippets.

View isaveu's full-sized avatar

James park isaveu

  • YMX Inc
  • Seoul, Korea
View GitHub Profile
@isaveu
isaveu / Bluetooth 개요.md
Created July 30, 2018 02:17 — forked from muabe/Bluetooth 개요.md
Bluetooth API 사용법

Bluetooth 개요

Android Bluetooth를 개발하기전에 Bluetooth 통신에대한 약간의 이해가 필요합니다.
Bluetooth Process를 간단히 설명하자면 주변에 연결하려는 디바이스를 찾고
찾은 기기중 연결할 기기에 인증을 받은 후 그리고 나서 통신을 합니다.

이 내용은 크게 Discovery,Pairing,Connection,Streaming 4가지 STEP으로 나눌수 있습니다.

1.Discovery

주변 디바이스 검색 합니다

  • Discovery는 주변에 블루투스와 연결 가능한 디바이스를 검색하는것 입니다.
@isaveu
isaveu / connectex-bind.cpp
Created August 7, 2018 14:15 — forked from joeyadams/connectex-bind.cpp
Working ConnectEx example
#include <stdio.h>
#include <WinSock2.h>
#include <MSWSock.h>
#include <WS2tcpip.h>
#pragma comment(lib, "Ws2_32.lib")
struct mswsock_s {
LPFN_CONNECTEX ConnectEx;
} mswsock;
@isaveu
isaveu / ScanBluetoothPorts.cs
Created August 8, 2018 23:55 — forked from smourier/ScanBluetoothPorts.cs
ScanBluetoothPorts
using System;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;
namespace ConsoleApp2
{
class Program
{
@isaveu
isaveu / SocketTasksFromAsync.cs
Created December 6, 2018 13:27 — forked from BasicPrinciples/SocketTasksFromAsync.cs
C# Socket Async Task Extension Methods
/**
* Author: [email protected]
* Date: 11/19/2015
* Namespace: SocketTasksFromAsync
* Class: SocketExtensions
* Revision: 1.0.0
* Purpose: Add tasks to the Socket class
*
* Description: Extension methods for System.Net.Sockets.Socket
* that wrap some of it's APM begin and end methods
@isaveu
isaveu / NetworkClient.cs
Created December 6, 2018 14:03 — forked from benloong/NetworkClient.cs
c# async socket client sample
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Net.Sockets;
using System.Net;
using System.Text;
using LitJson;
public class NetworkClient : MonoBehaviour {
@isaveu
isaveu / Gradient.cs
Created January 1, 2019 12:33 — forked from dxball/Gradient.cs
Unity UI Text Gradient effect
using System.Collections.Generic;
/// <summary>
/// Modified Gradient effect script from http://answers.unity3d.com/questions/1086415/gradient-text-in-unity-522-basevertexeffect-is-obs.html
/// -Uses Unity's Gradient class to define the color
/// -Offset is now limited to -1,1
/// -Multiple color blend modes
///
/// Remember that the colors are applied per-vertex so if you have multiple points on your gradient where the color changes and there aren't enough vertices, you won't see all of the colors.
/// </summary>
@isaveu
isaveu / GyroCamera.cs
Created February 18, 2019 13:20 — forked from kormyen/GyroCamera.cs
Unity3D script for rotating camera with a phone's gyro. Includes smoothing and initial offset. Edited from https://forum.unity3d.com/threads/sharing-gyroscope-camera-script-ios-tested.241825/
using UnityEngine;
using System.Collections;
public class GyroCamera : MonoBehaviour
{
// STATE
private float _initialYAngle = 0f;
private float _appliedGyroYAngle = 0f;
private float _calibrationYAngle = 0f;
private Transform _rawGyroRotation;
@isaveu
isaveu / GyroTest
Created February 18, 2019 13:21 — forked from chanibal/GyroTest
Unity3d relative gyroscope demo
using UnityEngine;
/// <summary>
/// Gyroscope demo. Attach to a visible object or camera.
/// </summary>
public class GyroTest:MonoBehaviour {
Quaternion origin=Quaternion.identity;
@isaveu
isaveu / GyroCamera.cs
Created February 18, 2019 13:22 — forked from unitycoder/GyroAttitude.cs
Gyroscope Camera Script
// from https://forum.unity3d.com/threads/sharing-gyroscope-camera-script-ios-tested.241825/#post-2954253
using UnityEngine;
using System.Collections;
public class GyroCamera : MonoBehaviour
{
private float initialYAngle = 0f;
private float appliedGyroYAngle = 0f;
private float calibrationYAngle = 0f;
@isaveu
isaveu / GravityCamera.cs
Created February 18, 2019 13:22 — forked from BichengLUO/GravityCamera.cs
A Unity3D script for rotating the camera according to the device's accelerometer
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
public class GravityCamera : MonoBehaviour
{
public GameObject target;
public Vector3 centerOffset;
public float sensitivity = 1000;