Skip to content

Commit d441069

Browse files
committed
Merge pull request #1 from sakapon/master-remastered
Reinitialize repository
2 parents bd04135 + 995ccd3 commit d441069

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+679
-6300
lines changed

.gitignore

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2+
[Bb]in/
3+
[Oo]bj/
4+
5+
# mstest test results
6+
TestResults
7+
8+
## Ignore Visual Studio temporary files, build results, and
9+
## files generated by popular Visual Studio add-ons.
10+
11+
# User-specific files
12+
*.suo
13+
*.user
14+
*.sln.docstates
15+
16+
# Build results
17+
[Dd]ebug/
18+
[Rr]elease/
19+
x64/
20+
*_i.c
21+
*_p.c
22+
*.ilk
23+
*.meta
24+
*.obj
25+
*.pch
26+
*.pdb
27+
*.pgc
28+
*.pgd
29+
*.rsp
30+
*.sbr
31+
*.tlb
32+
*.tli
33+
*.tlh
34+
*.tmp
35+
*.log
36+
*.vspscc
37+
*.vssscc
38+
.builds
39+
40+
# Visual C++ cache files
41+
ipch/
42+
*.aps
43+
*.ncb
44+
*.opensdf
45+
*.sdf
46+
47+
# Visual Studio profiler
48+
*.psess
49+
*.vsp
50+
*.vspx
51+
52+
# Guidance Automation Toolkit
53+
*.gpState
54+
55+
# ReSharper is a .NET coding add-in
56+
_ReSharper*
57+
58+
# NCrunch
59+
*.ncrunch*
60+
.*crunch*.local.xml
61+
62+
# Installshield output folder
63+
[Ee]xpress
64+
65+
# DocProject is a documentation generator add-in
66+
DocProject/buildhelp/
67+
DocProject/Help/*.HxT
68+
DocProject/Help/*.HxC
69+
DocProject/Help/*.hhc
70+
DocProject/Help/*.hhk
71+
DocProject/Help/*.hhp
72+
DocProject/Help/Html2
73+
DocProject/Help/html
74+
75+
# Click-Once directory
76+
publish
77+
78+
# Publish Web Output
79+
*.Publish.xml
80+
81+
# NuGet Packages Directory
82+
packages
83+
84+
# Windows Azure Build Output
85+
csx
86+
*.build.csdef
87+
88+
# Windows Store app package directory
89+
AppPackages/
90+
91+
# Others
92+
[Bb]in
93+
[Oo]bj
94+
sql
95+
TestResults
96+
[Tt]est[Rr]esult*
97+
*.Cache
98+
ClientBin
99+
[Ss]tyle[Cc]op.*
100+
~$*
101+
*.dbmdl
102+
Generated_Code #added for RIA/Silverlight projects
103+
104+
# Backup & report files from converting an old project file to a newer
105+
# Visual Studio version. Backup files are not needed, because we have git ;-)
106+
_UpgradeReport_Files/
107+
Backup*/
108+
UpgradeLog*.XML
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="NuGet.CommandLine" version="2.8.0" />
4+
</packages>

src/CSharp/FelicaLib.cs renamed to FelicaLib_Remastered/FelicaLib_DotNet/FelicaLib.cs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
felicalib - FeliCa access wrapper library
33
44
Copyright (c) 2007-2010, Takuya Murakami, All rights reserved.
@@ -44,7 +44,7 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
4444
namespace FelicaLib
4545
{
4646
/// <summary>
47-
/// DLL遅延バインディングクラス
47+
/// DLL遅延バインディングクラス
4848
/// </summary>
4949
public class BindDLL : IDisposable
5050
{
@@ -58,9 +58,9 @@ public class BindDLL : IDisposable
5858
private IntPtr _pModule;
5959

6060
/// <summary>
61-
/// DLLのロード・オブジェクト生成
61+
/// DLLのロード・オブジェクト生成
6262
/// </summary>
63-
/// <param name="szFilename">バインドするDLL名</param>
63+
/// <param name="szFilename">バインドするDLL名</param>
6464
public BindDLL(string szFilename)
6565
{
6666
_pModule = BindDLL.LoadLibrary(szFilename);
@@ -73,11 +73,11 @@ public BindDLL(string szFilename)
7373
}
7474

7575
/// <summary>
76-
/// 指定名のアンマネージ関数ポインタをデリゲートに変換
76+
/// 指定名のアンマネージ関数ポインタをデリゲートに変換
7777
/// </summary>
78-
/// <param name="szProcName">アンマネージ関数名</param>
79-
/// <param name="typDelegate">変換するデリゲートのType</param>
80-
/// <returns>変換したデリゲート</returns>
78+
/// <param name="szProcName">アンマネージ関数名</param>
79+
/// <param name="typDelegate">変換するデリゲートのType</param>
80+
/// <returns>変換したデリゲート</returns>
8181
public Delegate GetDelegate(string szProcName, Type typDelegate)
8282
{
8383
IntPtr pProc = BindDLL.GetProcAddress(_pModule, szProcName);
@@ -90,7 +90,7 @@ public Delegate GetDelegate(string szProcName, Type typDelegate)
9090
throw Marshal.GetExceptionForHR(nResult);
9191
}
9292

93-
#region IDisposable メンバ
93+
#region IDisposable メンバ
9494

9595
public void Dispose()
9696
{
@@ -103,21 +103,21 @@ public void Dispose()
103103
#endregion
104104
}
105105

106-
// システムコード
106+
// システムコード
107107
enum SystemCode : int
108108
{
109109
Any = 0xffff, // ANY
110-
Common = 0xfe00, // 共通領域
111-
Cyberne = 0x0003, // サイバネ領域
110+
Common = 0xfe00, // 共通領域
111+
Cyberne = 0x0003, // サイバネ領域
112112

113-
Edy = 0xfe00, // Edy (=共通領域)
114-
Suica = 0x0003, // Suica (=サイバネ領域)
113+
Edy = 0xfe00, // Edy (=共通領域)
114+
Suica = 0x0003, // Suica (=サイバネ領域)
115115
QUICPay = 0x04c1, // QUICPay
116116
}
117117

118118
public class Felica : IDisposable
119119
{
120-
// 遅延ロード用Delegate定義
120+
// 遅延ロード用Delegate定義
121121
private delegate IntPtr Pasori_open(String dummy);
122122
private delegate int Pasori_close(IntPtr p);
123123
private delegate int Pasori_init(IntPtr p);
@@ -127,7 +127,7 @@ public class Felica : IDisposable
127127
private delegate void Felica_getpmm(IntPtr f, byte[] data);
128128
private delegate int Felica_read_without_encryption02(IntPtr f, int servicecode, int mode, byte addr, byte[] data);
129129

130-
// 遅延ロード用Delegate
130+
// 遅延ロード用Delegate
131131
private Pasori_open pasori_open = null;
132132
private Pasori_close pasori_close = null;
133133
private Pasori_init pasori_init = null;
@@ -144,14 +144,14 @@ public class Felica : IDisposable
144144
private IntPtr felicap = IntPtr.Zero;
145145

146146
/// <summary>
147-
/// コンストラクタ
147+
/// コンストラクタ
148148
/// </summary>
149149
public Felica()
150150
{
151-
// x64対応 20100501 - DeForest
151+
// x64対応 20100501 - DeForest
152152
try
153153
{
154-
// プラットフォーム別のロードモジュール名決定(x64/x86サポート、Iteniumはサポート外)
154+
// プラットフォーム別のロードモジュール名決定(x64/x86サポート、Iteniumはサポート外)
155155
if (System.IntPtr.Size >= 8) // x64
156156
{
157157
szDLLname = "felicalib64.dll";
@@ -160,9 +160,9 @@ public Felica()
160160
{
161161
szDLLname = "felicalib.dll";
162162
}
163-
// DLLロード
163+
// DLLロード
164164
bdDLL = new BindDLL(szDLLname);
165-
// エントリー取得
165+
// エントリー取得
166166
pasori_open = (Pasori_open)bdDLL.GetDelegate("pasori_open", typeof(Pasori_open));
167167
pasori_close = (Pasori_close)bdDLL.GetDelegate("pasori_close", typeof(Pasori_close));
168168
pasori_init = (Pasori_init)bdDLL.GetDelegate("pasori_init", typeof(Pasori_init));
@@ -174,24 +174,24 @@ public Felica()
174174
}
175175
catch (Exception)
176176
{
177-
throw new Exception(szDLLname + " をロードできません");
177+
throw new Exception(szDLLname + " をロードできません");
178178
}
179179

180180
pasorip = pasori_open(null);
181181
if (pasorip == IntPtr.Zero)
182182
{
183-
throw new Exception(szDLLname + " を開けません");
183+
throw new Exception(szDLLname + " を開けません");
184184
}
185185
if (pasori_init(pasorip) != 0)
186186
{
187-
throw new Exception("PaSoRi に接続できません");
187+
throw new Exception("PaSoRi に接続できません");
188188
}
189189
}
190190

191-
#region IDisposable メンバ
191+
#region IDisposable メンバ
192192

193193
/// <summary>
194-
/// オブジェクト破棄時処理
194+
/// オブジェクト破棄時処理
195195
/// </summary>
196196
public void Dispose()
197197
{
@@ -209,32 +209,32 @@ public void Dispose()
209209
#endregion
210210

211211
/// <summary>
212-
/// デストラクタ
212+
/// デストラクタ
213213
/// </summary>
214214
~Felica()
215215
{
216216
Dispose();
217217
}
218218

219219
/// <summary>
220-
/// ポーリング
220+
/// ポーリング
221221
/// </summary>
222-
/// <param name="systemcode">システムコード</param>
222+
/// <param name="systemcode">システムコード</param>
223223
public void Polling(int systemcode)
224224
{
225225
felica_free(felicap);
226226

227227
felicap = felica_polling(pasorip, (ushort)systemcode, 0, 0);
228228
if (felicap == IntPtr.Zero)
229229
{
230-
throw new Exception("カード読み取り失敗");
230+
throw new Exception("カード読み取り失敗");
231231
}
232232
}
233233

234234
/// <summary>
235-
/// IDm取得
235+
/// IDm取得
236236
/// </summary>
237-
/// <returns>IDmバイナリデータ</returns>
237+
/// <returns>IDmバイナリデータ</returns>
238238
public byte[] IDm()
239239
{
240240
if (felicap == IntPtr.Zero)
@@ -245,12 +245,12 @@ public byte[] IDm()
245245
byte[] buf = new byte[8];
246246
felica_getidm(felicap, buf);
247247
return buf;
248-
}
248+
}
249249

250250
/// <summary>
251-
/// PMm取得
251+
/// PMm取得
252252
/// </summary>
253-
/// <returns>PMmバイナリデータ</returns>
253+
/// <returns>PMmバイナリデータ</returns>
254254
public byte[] PMm()
255255
{
256256
if (felicap == IntPtr.Zero)
@@ -261,14 +261,14 @@ public byte[] PMm()
261261
byte[] buf = new byte[8];
262262
felica_getpmm(felicap, buf);
263263
return buf;
264-
}
264+
}
265265

266266
/// <summary>
267-
/// 非暗号化領域読み込み
267+
/// 非暗号化領域読み込み
268268
/// </summary>
269-
/// <param name="servicecode">サービスコード</param>
270-
/// <param name="addr">アドレス</param>
271-
/// <returns>データ</returns>
269+
/// <param name="servicecode">サービスコード</param>
270+
/// <param name="addr">アドレス</param>
271+
/// <returns>データ</returns>
272272
public byte[] ReadWithoutEncryption(int servicecode, int addr)
273273
{
274274
if (felicap == IntPtr.Zero)

0 commit comments

Comments
 (0)